Skip to content
tezvyn:

IOS

317 bites tagged IOS — interview questions with model answers, and 60-second explainers.

iOS & Swift1 min read

Compare MVVM with unidirectional flow (TCA, Redux)

MVVM is lightweight with bidirectional binding and per-screen view models; unidirectional flow centralizes a single state mutated only by reducers via actions, gaining predictability and testability at… architectural trade-off judgment.

iOS & Swift1 min read

Diagnose and fix slow iOS app launch time

Pre-main covers dylib loading, rebasing, and static initializers; main covers didFinishLaunching and first frame; profile with Instruments, then defer work, reduce dynamic libraries, and trim… understanding launch phases and profiling.

iOS & Swift1 min read

Explain UIKit MVC and the Massive View Controller problem

Model holds data, View displays it, Controller mediates between them; the view controller accretes networking, parsing, and logic into a Massive View Controller. understanding UIKit's core pattern and its pitfall.

iOS & Swift1 min read

Describe the iOS app lifecycle and SceneDelegate methods

Not running, inactive, active, background, suspended; SceneDelegate handles sceneDidBecomeActive, sceneWillResignActive, sceneDidEnterBackground, sceneWillEnterForeground. knowledge of app and scene states.

iOS & Swift1 min read

How do you build a custom SwiftUI Layout?

Conform to Layout, implement sizeThatFits to report the container size for a proposal, and placeSubviews to position each subview using its measured size. SwiftUI's Layout protocol for bespoke arrangements.

iOS & Swift1 min read

How does Auto Layout resolve constraints?

Auto Layout solves a system of prioritized linear equations; intrinsicContentSize is a view's natural size; hugging resists growing, compression resistance resists shrinking. understanding constraint-based layout.

iOS & Swift1 min read

What is @autoclosure and when is it useful?

@autoclosure wraps an argument expression in a closure so it evaluates lazily only if used, enabling clean APIs like assert and the ?? operator. understanding deferred, lazy evaluation.

iOS & Swift1 min read

Why can't you subscript a Swift String with an Int?

Characters are extended grapheme clusters of variable byte width, so integer offsets are not O(1) or meaningful; String.Index is an opaque position you advance via the collection. understanding Unicode-correct strings.

iOS & Swift1 min read

How does Swift's switch differ from C's switch?

Switches must be exhaustive, there is no implicit fallthrough between cases, and cases can match ranges, tuples, and bind values. understanding Swift's safer control flow.

iOS & Swift1 min read

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.

Flutter & Dart1 min read

iOS code signing for a TestFlight release

A signing certificate proves who built the app; a provisioning profile ties cert, app ID and devices together; configure in Xcode, archive and upload. understanding Apple's signing model.

React Native3 min read

Native Module Threading Model

Native modules run on their own threads, not the JS thread or main UI thread. Heavy work stays off the JS event loop, but UI mutations must be manually dispatched to the main thread. Assuming they are main-thread safe causes crashes and ANRs.

React Native2 min read

Writing React Native iOS Modules in Swift

React Native speaks Objective-C on iOS, so Swift needs an Objective-C wrapper to join. Write logic in Swift, expose it via an Objective-C class, and register with RCT_EXPORT_MODULE. Skip the bridging header and the compiler never sees your Swift code.

React Native2 min read

iOS ViewManager: Native UI Bridge Factory

An iOS ViewManager is a bridge factory, not a view: it creates native UIViews and maps JS props to them. Use it for iOS surfaces like MapKit or camera previews JS cannot render. Never store view state in the manager; one manager vends many views.

iOS & Swift2 min read

Describe lightweight vs heavyweight Core Data migration and a heavyweight example

This tests inferred versus manual Core Data migrations. Contrast lightweight additive changes with heavyweight transforms like entity splits, citing promoting a string to a new entity. A red flag is claiming renames always need custom mapping.

iOS & Swift2 min read

Describe a pattern for background Core Data fetches and UI updates

This tests NSManagedObjectContext concurrency and queue confinement. Strong answer: create a background context, fetch, pass objectIDs or structs to main, then main context fetches by ID to update UI. Red flag: passing NSManagedObjects across threads.

iOS & Swift2 min read

How do you persist a custom Swift struct to JSON in Documents?

Tests fluency with Codable and FileManager sandbox APIs. Good answer: conform to Codable, encode with JSONEncoder, resolve Documents directory via FileManager URLs, write Data atomically, and reverse with JSONDecoder.

iOS & Swift2 min read

When is UserDefaults right, what are its limits, and native types?

Tests if you treat UserDefaults as a small preference store, not a database. Good answers name native plist types, cite no encryption and small size limits, and name Core Data or Keychain for heavy or sensitive data. Red flag: storing images or passwords.

iOS & Swift2 min read

Design state-driven navigation for a conditional wizard in UIKit and SwiftUI

This tests separating navigation state from UI. Model the flow as a state machine enum, derive the stack from state, and unit test transitions in plain Swift. A red flag is imperative pushes inside views or view controllers.

iOS & Swift2 min read

How would you architect the app root for onboarding vs authenticated flows?

Tests window root swapping and state-driven architecture. Use a coordinator to own the window, swap rootViewController between nav and tab controllers on auth changes, and crossfade. Red flag: onboarding modal over tabs or keeping both hierarchies alive.

iOS & Swift2 min read

What NavigationView limitations did NavigationStack solve for programmatic navigation?

This tests why NavigationView programmatic navigation was brittle. A strong answer contrasts scattered NavigationLink isActive booleans and broken multi-destination stacks against NavigationStack's unified path array. A red flag is calling it a simple rename.

iOS & Swift2 min read

How do you pop to root in SwiftUI NavigationStack?

This tests declarative state-driven navigation. A strong answer binds NavigationStack to a NavigationPath, passes the binding down, and clears the path to pop to root. A red flag is suggesting UIKit popToRootViewController or legacy isActive hacks.

iOS & Swift2 min read

Handle a deep link URL in SceneDelegate and navigate to order detail.

Handles willConnectTo and openURLContexts; parses path with URLComponents; validates ID; pushes detail onto nav stack. iOS scene-based deep links. Forgetting warm launches or routing without checking view hierarchy.

iOS & Swift2 min read

Pass data back from a modally presented view controller delegate versus closure

This tests decoupled UIKit communication and memory safety. A strong answer outlines a weak delegate protocol and a closure with weak self, contrasting coupling and retain cycles. Red flag: singletons or direct parent references.

Get IOS bites daily.

Five a day, five minutes, offline. With quizzes so it sticks.

Open testing — you’ll join as an early tester.