iOS

Test yourself

Quiz — Multiple Choice

Pick an answer; it instantly marks it right or wrong and explains why. Your answers are saved in this browser, so you can come back and finish.

Score 0 / 0 answered · 228 total
  1. Q1You assign a struct value to a new variable and mutate the copy. The original is:Swift Language
  2. Q2Which is the safest way to handle a value that may be nil?Swift Language
  3. Q3What prevents a strong reference cycle between two class instances?Swift Language
  4. Q4Swift 6's headline change is:Swift Language
  5. Q5In ForEach, using the array index as id can cause:SwiftUI
  6. Q6Which wrapper marks state OWNED by the current view?SwiftUI
  7. Q7The advantage of @Observable over ObservableObject is:SwiftUI
  8. Q8.padding().background(.red) vs .background(.red).padding() differ because:SwiftUI
  9. Q9What does awaiting an async call do to the thread?Concurrency
  10. Q10To protect a mutable cache accessed by many tasks, you'd use:Concurrency
  11. Q11Code that updates the UI should run on:Concurrency
  12. Q12async let is used to:Concurrency
  13. Q13Where should an authentication token be stored?Data & Networking
  14. Q14To map JSON full_name to a Swift property fullName you can:Data & Networking
  15. Q15SwiftData is best described as:Data & Networking
  16. Q16The biggest build/structure win for a large app is usually:Architecture
  17. Q17Injecting an APIClient protocol into a view model primarily improves:Architecture
  18. Q18Before optimizing, you should:Performance
  19. Q19A janky image feed most often improves when you:Performance
  20. Q20A provisioning profile ties together:CI/CD & Tooling
  21. Q21CFBundleVersion (build number) must:CI/CD & Tooling
  22. Q22A phased release lets you:App Store
  23. Q23App Transport Security (ATS) by default:Security
  24. Q24A key benefit of on-device ML (Core ML) over a server call is:On-Device AI
  25. Q25`some View` (an opaque return type) means the function returns:Swift Language
  26. Q26To pass measured size from a child UP to an ancestor you use:SwiftUI
  27. Q27Actor reentrancy means that across an await inside an actor method:Concurrency
  28. Q28AsyncStream is most commonly used to:Concurrency
  29. Q29Compared with a plain dictionary, NSCache automatically:Data & Networking
  30. Q30A headline feature of StoreKit 2 is:App Store
  31. Q31Public-key pinning protects against:Security
  32. Q32Feature flags primarily let you:Architecture
  33. Q33To run a third-party trained model on iOS you typically:On-Device AI
  34. Q34Which framework gives you on-device text embeddings for semantic search?On-Device AI
  35. Q35A home-screen widget's content is:SwiftUI
  36. Q36An app and its widget share stored data through:Data & Networking
  37. Q37To respect Dynamic Type you should:SwiftUI
  38. Q38The Neural Engine's role is to:On-Device AI
  39. Q39For a dynamic number of concurrent child tasks you should use:Concurrency
  40. Q40Task.detached is discouraged by default because it:Concurrency
  41. Q41Blocking a cooperative-pool thread with synchronous I/O is bad because:Concurrency
  42. Q42The Clean Architecture dependency rule says dependencies point:Architecture
  43. Q43Two feature modules need to navigate to each other. The clean fix is:Architecture
  44. Q44Typed throws (Swift 6) let a function:Swift Language
  45. Q45A 'hitch' refers to:Performance
  46. Q46App Attest is used to:Security
  47. Q47Changing a view's .id(value) causes SwiftUI to:SwiftUI
  48. Q48Wrapping views in AnyView is discouraged because it:SwiftUI
  49. Q49A shared-element 'hero' transition between two views is built with:SwiftUI
  50. Q50The recommended implicit-animation modifier is:SwiftUI
  51. Q51To animate a custom Shape's parameter, you implement:SwiftUI
  52. Q52For a custom flow/tag arrangement that stacks can't express, you use:SwiftUI
  53. Q53An app that is essentially a wrapper around your website is rejected under:App Store
  54. Q54Unlocking digital content used in the app must use:App Store
  55. Q55An app that lets users create an account must also:App Store
  56. Q56If you offer Google/Facebook social login as a primary option, you must also offer:App Store
  57. Q57Before accessing the IDFA / tracking across other companies' apps, you must:App Store
  58. Q58A login-gated app submitted for review should include:App Store
  59. Q59In StoreKit 2, you should grant an entitlement only when the transaction is:App Store
  60. Q60The reliable source of truth for what a user currently owns on-device is:App Store
  61. Q61Swift macros run:Swift Language
  62. Q62@Observable and #Preview are, respectively:Swift Language
  63. Q63A macro implementation depends on:Swift Language
  64. Q64A type-safe reference to a property like \Type.name is a:Swift Language
  65. Q65Mirror (reflection) is best described as:Swift Language
  66. Q66The $ prefix on a property wrapper gives you its:Swift Language
  67. Q67A Home Screen widget's content is best described as:SwiftUI
  68. Q68Tapping a Button inside an iOS 17 interactive widget runs:SwiftUI
  69. Q69For UI that must change while visible on the Lock Screen / Dynamic Island, use:SwiftUI
  70. Q70In ActivityAttributes, the values you update over time live in:SwiftUI
  71. Q71App Intents expose your app's actions to:SwiftUI
  72. Q72To let an intent accept one of your model objects as a parameter, you implement:SwiftUI
  73. Q73An icon-only button with no accessibilityLabel reads to VoiceOver as:SwiftUI
  74. Q74Marking section titles with the .isHeader trait primarily helps users:SwiftUI
  75. Q75To support Dynamic Type, you should mainly:SwiftUI
  76. Q76Conveying success/error with color only is a problem because:SwiftUI
  77. Q77The minimum recommended touch-target size is about:SwiftUI
  78. Q78In XCUITest you should query elements by:Testing
  79. Q79In Swift Charts, you build a chart from:SwiftUI
  80. Q80To color/stack a bar chart by category you use:SwiftUI
  81. Q81Bars can mislead if you don't set:SwiftUI
  82. Q82iOS 17 tooltip selection is done with:SwiftUI
  83. Q83With a 50k-point time series you should:Performance
  84. Q84A donut chart in Swift Charts uses:SwiftUI
  85. Q85In the iOS 17 SwiftUI Map, you add pins with:SwiftUI
  86. Q86The blue user-location dot appears only when:SwiftUI
  87. Q87As-you-type place suggestions use:Data & Networking
  88. Q88Since iOS 14, a user may grant location that is:Security
  89. Q89For low-power background location, prefer:Data & Networking
  90. Q90A common App Review rejection around location is:Security
  91. Q91Native WebSocket support comes from:Data & Networking
  92. Q92To process a server token/event stream incrementally, use:Data & Networking
  93. Q93Transfers that must continue when the app is suspended need a:Data & Networking
  94. Q94Certificate pinning is implemented via:Security
  95. Q95An ETag enables the server to respond with:Data & Networking
  96. Q96On HTTP 429, the best first move is to:Data & Networking
  97. Q97The device token for remote push is delivered to your app in:Data & Networking
  98. Q98The preferred way for a server to authenticate to APNs is:Data & Networking
  99. Q99To modify or decrypt a push before it's shown (e.g. attach media), use:Data & Networking
  100. Q100A push with content-available: 1 and no alert is:Data & Networking
  101. Q101An interruption level that breaks through Focus requires:Data & Networking
  102. Q102A dev build's push token works against:Data & Networking
  103. Q103Watch complications today are built with:SwiftUI
  104. Q104iPhone↔Watch communication uses:Data & Networking
  105. Q105A watch app can keep running in the background mainly during:SwiftUI
  106. Q106Primary input on visionOS is:SwiftUI
  107. Q107To call an iOS 17 API while supporting iOS 16, you use:Architecture
  108. Q108The cleanest way to share logic across iOS/watchOS/macOS targets is:Architecture
  109. Q109A camera capture pipeline is built around:Data & Networking
  110. Q110To let users pick photos WITHOUT any library permission, use:SwiftUI
  111. Q111Using the camera requires:Security
  112. Q112Background audio + Lock Screen controls require populating:Data & Networking
  113. Q113For real-time effects and mixing multiple audio sources, use:Data & Networking
  114. Q114When processing camera frames you should:Performance
  115. Q115To find out WHAT is mutating a variable, set a:Testing
  116. Q116You should profile performance on:Performance
  117. Q117Memory that's still referenced but never freed (e.g. an unbounded cache) is best found with:Performance
  118. Q118A retain cycle is fastest to pinpoint with:Performance
  119. Q119Function names in a production crash report require:Testing
  120. Q120Which tool catches data races at runtime?Testing
  121. Q121What does the actual drawing/compositing for a UIView?UIKit
  122. Q122A shadow without a shadowPath is expensive because it causes:Performance
  123. Q123shouldRasterize is a win for:Performance
  124. Q124A callback synchronized to each display refresh comes from:UIKit
  125. Q125You'd reach for Metal directly when:Performance
  126. Q126Custom CADisplayLink animation on ProMotion should be:Performance
  127. Q127If HealthKit read access is denied, your app:Security
  128. Q128For a daily step-count total you'd use:Data & Networking
  129. Q129To be woken when new health data arrives in the background, use:Data & Networking
  130. Q130In HomeKit, the on/off state of a bulb is a:Data & Networking
  131. Q131For stable device orientation you should read:Data & Networking
  132. Q132Motion activity (walking/driving) classification requires:Security
  133. Q133A CIImage represents:Data & Networking
  134. Q134You should create a CIContext:Performance
  135. Q135Chaining five CIFilters results in:Data & Networking
  136. Q136To show many large photos without blowing memory, you should:Performance
  137. Q137The modern way to render a UIImage off-screen is:Data & Networking
  138. Q138For face detection today you use:Data & Networking
  139. Q139SpriteKit is the right tool for:SwiftUI
  140. Q140To make SpriteKit motion frame-rate independent, use:Performance
  141. Q141In SpriteKit, to be notified when two bodies touch (without bouncing) you set:Performance
  142. Q142RealityKit is architected around:Performance
  143. Q143In ARKit, the rendering vs tracking split is:Performance
  144. Q144To place an object where the user taps a real surface, use:Performance
  145. Q145In Package.swift, a 'product' is:CI/CD & Tooling
  146. Q146Bundled package resources are accessed at runtime via:CI/CD & Tooling
  147. Q147What does a dependency rule of from: 1.2.0 allow?CI/CD & Tooling
  148. Q148Local Swift packages mainly help by:Architecture
  149. Q149Putting build settings in xcconfig files primarily:CI/CD & Tooling
  150. Q150A custom Run Script phase that runs on every build (even when nothing changed) is missing:CI/CD & Tooling
  151. Q151To let a user pick one contact WITHOUT a permission prompt, use:Data & Networking
  152. Q152In iOS 17, an app that only adds calendar events should request:Security
  153. Q153Before presenting MFMailComposeViewController you must:Data & Networking
  154. Q154Why do the mail/message compose controllers need no special permission?Security
  155. Q155Presenting UIActivityViewController on iPad requires:Data & Networking
  156. Q156ShareLink can share any item that is:SwiftUI
  157. Q157A user's own private CloudKit data is stored:Data & Networking
  158. Q158To learn that CloudKit data changed without polling, use:Data & Networking
  159. Q159Efficient incremental CloudKit sync relies on:Architecture
  160. Q160A CloudKit save failing with serverRecordChanged means you should:Architecture
  161. Q161For Core Data/SwiftData CloudKit mirroring, the model must have:Data & Networking
  162. Q162Syncing a handful of small preferences across devices is best done with:Data & Networking
  163. Q163In Combine, a publisher emits:Concurrency
  164. Q164To debounce a search field in Combine you use:Concurrency
  165. Q165Which subject replays its latest value to new subscribers?Concurrency
  166. Q166To deliver values on the main thread for UI updates, add:Concurrency
  167. Q167If you don't store the AnyCancellable from sink:Concurrency
  168. Q168A Combine publisher can be consumed with async/await via:Concurrency
  169. Q169To add one day to a Date you should:Swift Language
  170. Q170The modern, locale-aware way to display a date is:Data & Networking
  171. Q171You should store/transmit timestamps as:Data & Networking
  172. Q172Hardcoding a date pattern like MM/dd/yyyy or a $ currency prefix is wrong because:Data & Networking
  173. Q173Regenerable cached files should go in:Data & Networking
  174. Q174Swift's native Regex (5.7) advantage over NSRegularExpression is:Swift Language
  175. Q175A delegate property should be declared weak to:Architecture
  176. Q176The main downside of using singletons for your services is:Architecture
  177. Q177Dependency injection primarily improves:Architecture
  178. Q178Lifting navigation out of view controllers into a dedicated object is the:Architecture
  179. Q179To make impossible states unrepresentable, model state as:Architecture
  180. Q180Wrapping a third-party SDK behind a protocol you own is the:Architecture
  181. Q181The biggest single lever on pre-main launch time is usually:Performance
  182. Q182To keep launch fast you should:Performance
  183. Q183Launch prewarming means you should NOT assume:Performance
  184. Q184What lets the App Store deliver only the assets/architecture a device needs?CI/CD & Tooling
  185. Q185To shrink the initial download by deferring optional content, use:CI/CD & Tooling
  186. Q186Your true per-device download size is shown by:CI/CD & Tooling
  187. Q187In SwiftUI, a string literal passed to Text(...) is:SwiftUI
  188. Q188The modern, auto-extracting localization format is:SwiftUI
  189. Q189A sentence like You have 3 messages is best implemented with:SwiftUI
  190. Q190Format strings with two arguments should use:Data & Networking
  191. Q191For correct right-to-left mirroring you should use:SwiftUI
  192. Q192Pseudolocalization helps you catch, before real translations:Testing
  193. Q193To move focus between fields or dismiss the keyboard in SwiftUI, use:SwiftUI
  194. Q194To surface an SMS one-time code in the QuickType bar, set the field's:SwiftUI
  195. Q195Keyboard avoidance in SwiftUI is:SwiftUI
  196. Q196Unhandled input/editing actions travel up the:UIKit
  197. Q197To replace the system keyboard for a field with your own number pad, set:UIKit
  198. Q198Reformatting text on every keystroke risks:SwiftUI
  199. Q199Adding a .mlpackage to an Xcode project gives you:On-Device AI
  200. Q200To run many inferences efficiently you should:On-Device AI
  201. Q201A model runs partly on CPU even with .all because:On-Device AI
  202. Q202Fine-tuning a model on the user's own data, privately, uses:On-Device AI
  203. Q203To shrink a Core ML model you'd use coremltools to:On-Device AI
  204. Q204Running an image classification Core ML model is easiest with:On-Device AI
  205. Q205In Swift Testing, the macro that stops the test and can unwrap an optional is:Testing
  206. Q206Running one test body over many inputs uses:Testing
  207. Q207The TDD cycle is:Testing
  208. Q208The cleanest way to mock a dependency in Swift is:Testing
  209. Q209UI tests should locate elements by:Testing
  210. Q210A common cause of flaky tests is:Testing
  211. Q211SwiftUI drag and drop for your own typed payload uses:SwiftUI
  212. Q212To reorder rows in a List you add:SwiftUI
  213. Q213The currency for exchanging drag/drop data is:UIKit
  214. Q214As the user hovers a drag over a UIKit target, the delegate returns a:UIKit
  215. Q215Loading dropped data is asynchronous because:SwiftUI
  216. Q216Good drag-and-drop UX should:SwiftUI
  217. Q217some P (opaque) differs from any P (existential) in that some P:Swift Language
  218. Q218A protocol with an associatedtype historically couldn't be used as:Swift Language
  219. Q219some Collection<Int> (Swift 5.7) is enabled by:Swift Language
  220. Q220Array is Equatable only when its Element is — this is:Swift Language
  221. Q221A generic parameter used only for compile-time tagging (no stored value) is a:Swift Language
  222. Q222In a hot path, prefer generics over `any` existentials because generics:Swift Language
  223. Q223The single most important decision for an offline-first app is:Architecture
  224. Q224A smooth image-heavy feed depends most on:Architecture
  225. Q225Modeling checkout as a state machine helps by:Architecture
  226. Q226Cross-feature navigation in a modular app without import cycles uses:Architecture
  227. Q227The recommended way to migrate UIKit → SwiftUI is:Architecture
  228. Q228You should add an extra layer or protocol when:Architecture