Mobile App Developer
Swift and iOS questions
130 questions on Swift and iOS for mobile app developers, easiest first.
Easy 38
- Safely unwrapping a Swift optionaleasy
- Swift struct assignment copieseasy
- Swift class shared referenceeasy
- Layering views in SwiftUIeasy
- Crash when asking for the cameraeasy
- Decoding JSON with extra keyseasy
- What await means in Swifteasy
- iOS build fails after adding a libraryeasy
- iOS app moved to the backgroundeasy
- viewDidLoad or viewWillAppeareasy
- Points to pixels on a @3x iPhoneeasy
- HTTP request blocked on iOSeasy
- Urgent fix waiting in revieweasy
- Rejected for app completenesseasy
- let compared with vareasy
- What guard let is foreasy
- Giving an optional a defaulteasy
- Type of an optional chaineasy
- Force unwrapping nileasy
- Short form of if leteasy
- A switch without defaulteasy
- What try? returnseasy
- Reading a missing keyeasy
- Putting a struct in a Seteasy
- Summing with reduceeasy
- A computed propertyeasy
- Changing a struct inside a methodeasy
- Marking UI code with @MainActoreasy
- Mapping with a key patheasy
- Closing a sheet from inside iteasy
- ForEach over a custom structeasy
- viewDidLoad vs viewWillAppeareasy
- Using a SwiftUI view in UIKiteasy
- Fetching data with async/awaiteasy
- HTTP request blockedeasy
- Refresh token in UserDefaultseasy
- Localising strings in Xcodeeasy
- Previewing a SwiftUI vieweasy
Medium 51
- @State vs @Binding in SwiftUImedium
- Owning an @Observable modelmedium
- SwiftUI .task when leaving a screenmedium
- Updating UI from a detached taskmedium
- Unreadable iOS crash stack tracesmedium
- Relying on silent pushes for syncmedium
- Why SceneDelegate existsmedium
- The @Observable macro in SwiftUImedium
- Supporting Dynamic Type on iOSmedium
- Podcast stops when the screen locksmedium
- Asking for push without a promptmedium
- APNs key or certificatemedium
- Which iOS location permission to askmedium
- Using the advertising identifier on iOSmedium
- Card number in the app switchermedium
- TestFlight internal and external testersmedium
- How iOS phased release worksmedium
- Upload rejected for the same versionmedium
- Paying for groceries in an iOS appmedium
- Reading an associated valuemedium
- Returning some View from two branchesmedium
- Constraining a generic functionmedium
- When @escaping is neededmedium
- Order of defer blocksmedium
- Result in a completion handlermedium
- JSON key differs from propertymedium
- Floating-point money errorsmedium
- Adding past Int8.maxmedium
- Getting the first charactermedium
- Parsing numbers from textmedium
- Reacting when a value changesmedium
- private or fileprivatemedium
- Passing a value to change itmedium
- Why delegates are weakmedium
- Two async let callsmedium
- Downloading a list of imagesmedium
- Calling into an actormedium
- Cancelling a long loopmedium
- Reading a file line by linemedium
- Binding to an @Observable modelmedium
- Opening a deep link three screens inmedium
- Data loaded again and againmedium
- Sorting inside bodymedium
- Showing a sheet for a tapped ordermedium
- Showing SwiftData resultsmedium
- Wrapping a UIKit view in SwiftUImedium
- Saving a draft when the app leavesmedium
- Handling the APNs device tokenmedium
- Swift Testing assertionsmedium
- Images reload while scrollingmedium
- Combine sink never firesmedium
Hard 41
- Memory leak with a closurehard
- One failing request in coroutineScopehard
- Actor reentrancy in an image cachehard
- Task vs Task.detachedhard
- unowned self in a network callbackhard
- When a Swift array is copiedhard
- Keychain read fails in backgroundhard
- When a BGAppRefreshTask runshard
- canOpenURL returns false on iOShard
- App killed during a slow launchhard
- Core Data objects across threadshard
- Large downloads in Documents on iOShard
- Downloads that continue after the app closeshard
- App killed in the background on iOShard
- Images in iOS push notificationshard
- User selects "Limited" photo accesshard
- Apple privacy manifesthard
- Extension method that is not a requirementhard
- some Shape or any Shapehard
- Closure capture listhard
- Typed throwshard
- imageURL is always nilhard
- Date decoding fails on millisecondshard
- Counting an emojihard
- Passing a class into a Taskhard
- Global cache in Swift 6hard
- Using nonisolated in an actorhard
- Turning a delegate into an AsyncSequencehard
- Bridging a callback with a continuationhard
- Blocking inside an async functionhard
- How if works in a SwiftUI bodyhard
- What the $ prefix giveshard
- Rows showing the wrong datahard
- Wrong photo in a reused cellhard
- sync on the main queuehard
- Universal links open Safarihard
- App rejected for UserDefaults usehard
- @State ignores the new valuehard
- Importing 50,000 rows in SwiftDatahard
- Which views update with @Observablehard
- Search that restarts on new texthard