This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension View { | |
| // MARK: - Debounce with Binding | |
| func debounce<T: Sendable & Equatable>(_ query: Binding<T>, using channel: AsyncChannel<T>, for duration: Duration, action: @Sendable @escaping (T) async -> Void) -> some View { | |
| self | |
| .task { | |
| for await query in channel.debounce(for: duration) { | |
| await action(query) | |
| } | |
| } | |
| .task(id: query.wrappedValue) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. - Iterate over items and indices in collections | |
| var ingredients = ["potatoes", "cheese", "cream"] | |
| for (i, ingredient) in ingredients.enumerated() { | |
| // The counter helps us display the sequence number, not the index | |
| print("ingredient number \(i + 1) is \(ingredient)") | |
| } | |
| // Array<String>.SubSequence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - Pluginfile | |
| gem 'xcode-install' | |
| - Fastfile | |
| platform :ios do | |
| desc "Xcode install" | |
| lane :install_xcode do | |
| xcode_install( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Simulator creation | |
| sim_name="PR-23175-rappi" | |
| create_output=$(xcrun simctl create $sim_name com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus) | |
| echo $create_output | |
| simulator_id=$(echo $create_output | tail -1) | |
| # Simulator validation | |
| xcrun simctl list devices $simulator_id | |
| # Xcode test | |
| xcodebuild test -destination "platform=iOS Simulator,id=$simulator_id" ... | |
| # Simulator deletion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Private key import | |
| security import $PRIVATE_KEY_FILE -k $RAPPI_KEYCHAIN -f pkcs12 -P $KEYCHAIN_PWD -A | |
| # Private key to pem | |
| openssl pkcs12 -in $PRIVATE_KEY_FILE -out $PRIVATE_KEY_FILE.pem -nocerts -nodes -passin pass:$PRIVATE_KEY_PWD | |
| # Key modulus | |
| key_modulus=$(openssl rsa -noout -modulus -in $PRIVATE_KEY_FILE.pem | openssl md5) | |
| for cert in $certs_dir/*; do | |
| # Cert verification | |
| security verify-cert -c $cert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum APIEnvironment: String, CaseIterable { | |
| case dev | |
| case test | |
| case stage | |
| case prod | |
| } | |
| struct ContentView: View { | |
| @State private var selection: APIEnvironment? = env | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private final class AppInfo { | |
| private struct Keys { | |
| static let lastKnownAppVersion = "app_data.last_known_app_version" | |
| static let appWasInBackground = "app_data.app_was_in_background" | |
| static let appWasTerminated = "app_data.app_was_terminated" | |
| } | |
| struct State { | |
| let appVersionIsChanged: Bool | |
| let appWasInBackground: Bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def is_valid_state(state): | |
| # check if it is a valid solution | |
| return True | |
| def get_candidates(state): | |
| return [] | |
| def search(state, solutions): | |
| if is_valid_state(state): | |
| solutions.append(state.copy()) |
General iOS, CS questions and interview prep resources.
-
iOS Interview Questions for Senior Developers (useful even if you're not senior yet)
NewerOlder