Intermediate concepts in iOS & Swift, page 5
Unwind Segues: Jump Back in the Stack
An unwind segue jumps from a deep screen to an earlier view controller without manual popping. Use it after multi-step flows to return to a root screen. If multiple screens share the same action, UIKit picks the nearest one and silently routes users wrong.
withCheckedThrowingContinuation: Bridge Callbacks to Async/Await
withCheckedThrowingContinuation bridges legacy completion-handler APIs into async/await. Wrap one-shot callback-based work so callers use try await instead of nested blocks. The footgun is resuming twice or never, which checked runtimes catch in debug builds.
withAnimation: The Implicit Animation Transaction
withAnimation wraps state changes in a transaction, telling SwiftUI to tween affected layout automatically. Call it from button actions or view model methods to animate many views from one state flip.
Custom Rendering with draw(_:)
draw(_:) is the callback where UIKit asks your view for pixels. Override it to render custom shapes or text with Core Graphics when stock views fall short. The footgun is calling it directly or doing non-drawing work inside; use setNeedsDisplay() instead.
MatchedGeometryEffect: Shared Element Hero Transitions
MatchedGeometryEffect lets two views share one spatial identity, so a thumbnail can appear to fly into a detail sheet across view hierarchies. It only works if both views exist simultaneously during a withAnimation block; otherwise the transition snaps.
XCTestCase: One Fresh Instance Per Test
A XCTestCase subclass is a lab bench for isolated experiments. Each test method is a fresh invocation checked by the runner. The silent killer is shared mutable state on the case: without setUp, tests flake because execution order is never guaranteed.
Test Plans (XCTestPlan)
A Test Plan is an Xcode configuration file decoupling which tests run from how they run, letting one scheme execute many configurations: localizations, sanitizers, randomized order, and repetition, all without editing the scheme.
Dependency Resolution in iOS Package Managers
Dependency resolution finds one version of every library that satisfies all transitive requirements. It runs when SPM, CocoaPods, or Carthage builds your graph. The footgun is tight upper bounds; they multiply unresolvable diamond conflicts.
XCFrameworks: One Bundle for Every Apple Platform
An XCFramework is a shipping container for compiled Apple libraries: one bundle holds device, simulator, and Mac binaries so Xcode picks the right slice automatically. Use it to distribute closed-source SDKs.
@objc: Swift's Bridge to Objective-C
@objc is the bridge badge that exposes Swift code to the Objective-C runtime so UIKit selectors and KVO work. You need it for target-action and Core Data. Forget it and you get a runtime crash, not a compiler error.
Profiling iOS Memory with Instruments
Instruments X-rays your heap to catch objects that outstay their welcome. Profile image-heavy features or when jetsam kills your app. Never trust Simulator memory numbers; always validate on physical hardware.
Thread Sanitizer catches data races in Swift
Thread Sanitizer turns flaky race crashes into reproducible reports by monitoring memory accesses at runtime. Use it in Xcode to catch unsynchronized cross-thread reads and writes. It only catches races that execute during your test run, so coverage matters.
KVO: Swift's Built-In Observer Pattern
KVO lets an object subscribe to property changes on another object automatically. It shines when you need UI updates driven by model state, but forgetting to remove observers before deallocation crashes your app with an NSException.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles