iOS Development (Swift and Objective-C) Questions
Native iOS programming: the Swift language and Objective-C, Automatic Reference Counting and memory semantics, threading and concurrency on Apple platforms, and iOS SDK fundamentals. Covers writing correct native iOS code and reasoning about the platform's runtime and language rules. The primary Apple-platform mobile surface.
You must choose between Combine, RxSwift, and traditional delegates/closures for an app that performs complex real-time transformations over streaming data (filters, retries, reconnects). Evaluate the trade-offs in expressiveness, operator availability, performance, interoperability with Objective-C, learning curve, and testability. Which would you pick and why (assume you control platform minimums)?
In Swift, compare struct and class. Explain differences in memory behavior (value vs reference), copying semantics, inheritance support, mutability rules (mutating keyword), and thread-safety implications. For an iOS app data model, provide guidelines when you would choose a struct vs a class and a short example use-case for each.
Demonstrate dependency injection for a UIViewController in Swift to make it unit-testable. Provide example code showing a protocol for a service (e.g., APIClient), a concrete implementation, and how to inject a mock in tests. Discuss trade-offs between initializer injection, property injection, and storyboard-instantiated controllers.
Architect an offline-first sync mechanism for an iOS app that must allow creating and editing large datasets offline and later sync with a server. Requirements: efficient network usage, conflict resolution, background syncing, and minimal battery use. Describe data modeling (operation log/tombstones), sync algorithm (deltas, batching), conflict strategies (last-write-wins vs CRDTs), scheduling with BGTaskScheduler, and testing/monitoring approaches.
Explain closures in Swift and the difference between escaping and non-escaping closures. What does the @escaping attribute mean, when is it required, and how does it affect capturing semantics? Provide a short example where a closure must be marked @escaping and how to avoid strong self capture inside it.
Unlock Full Question Bank
Get access to all 33 iOS Development (Swift and Objective-C) interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.