Intermediate concepts in iOS & Swift, page 2

UISceneDelegate: Managing Your App's UI Instances
Think of SceneDelegate as the lifecycle manager for a single window of your app's UI. It's essential for multi-window iPad apps, handling when a scene connects, disconnects, or changes state.

MVVM: Separate SwiftUI Logic from Layout
MVVM separates logic from layout by moving state and business logic out of your SwiftUI View into a dedicated ViewModel class. This makes your code cleaner, more organized, and easier to test.

Dependency Injection in Swift: Stop Creating, Start Receiving
Dependency Injection means objects receive their dependencies from the outside rather than creating them internally. It's used to give a view model a network client or data source, making it testable.

iOS Background Modes: A Hall Pass for Your App
iOS background modes are like hall passes, letting your app perform specific tasks like playing audio or tracking location after the user switches away. They're used for music players or navigation apps.

The Singleton Pattern: One Instance to Rule Them All
A singleton ensures a class has only one instance and provides a global access point to it. It's used for shared resources like a network manager or logger. The main footgun is that overuse creates tight coupling and makes testing difficult.

NavigationStack: Programmatic Navigation in SwiftUI
Think of NavigationStack as a pile of views. You push new views onto the stack programmatically by appending to a path array. This is SwiftUI's modern, data-driven way to handle deep navigation, replacing the older, buggier NavigationView.

NavigationLink: Pushing Views in SwiftUI
NavigationLink is SwiftUI's declarative way to push a new view onto a navigation stack. You use it inside a NavigationStack to create drill-down UIs, like tapping a list item to see its details. The footgun is forgetting the parent NavigationStack.

NavigationSplitView: Adaptive Layouts for All Screen Sizes
NavigationSplitView is a responsive container for multi-column layouts. It shows a sidebar, content, and detail view on large screens but collapses to a stack on small ones. Use it for master-detail UIs like a mail app.

Keychain Services: A Secure Vault for Small Secrets
Think of Keychain as a system-managed safe deposit box for small secrets like passwords or tokens. It's the go-to for storing API keys or user credentials securely. The main footgun is its clunky C-style API, leading most developers to use a wrapper.

Core Data: An Object Graph, Not Just a Database
Core Data isn't just a database wrapper; it's an object graph manager that can persist data. Use it for complex model layers in iOS/macOS apps, especially for caching or document-based work. The footgun is treating it like a simple ORM.

SwiftData
SwiftData is Apple's Swift native persistence framework, introduced in 2023 as a modern layer over the same storage engine Core Data uses. You declare models with the Model macro instead of a visual schema editor, and SwiftUI views stay in sync automatically.
SQLite: A Database in a Single File
SQLite is a self-contained SQL database engine that lives in a single file. It's ideal for mobile apps needing fast, reliable local data storage without a server. The footgun is using it for high-concurrency write scenarios, where it becomes a bottleneck.

Realm Database
Realm is an object oriented mobile database that stores your Swift model objects directly, without an ORM layer translating to and from SQL, and gives you live objects that automatically update in your UI whenever the underlying data changes.

App Groups: Sharing Data Between Your Apps & Extensions
App Groups create a shared 'lockbox' for your apps and extensions on a user's device, bypassing the default app sandbox. Use it to share UserDefaults or files between your main app and its widget. The footgun: you must use specific APIs and manage data sync.

Swift Task
Task is the unit of concurrent work in Swift's structured concurrency model. Creating a Task starts an async job right away, and Swift tracks its priority, cancellation, and lifetime automatically instead of leaving you to manage threads by hand.

URLSessionConfiguration: The Blueprint for Network Requests
Think of URLSessionConfiguration as a blueprint for your network sessions. It defines rules like timeouts and caching policies upfront. Use it to create customized sessions, but remember you can't change the configuration after the session is created.

HTTPURLResponse: Reading the Server's Reply
Think of HTTPURLResponse as the envelope for a server's reply. It holds metadata like the status code (200 OK, 404 Not Found) and headers. You'll handle this after every URLSession call to check if your request succeeded.

MainActor: Keep Your UI on the Main Thread
The MainActor is a global actor ensuring code runs on the main thread, the only safe place for UI updates. Use it when modifying UIKit or SwiftUI views. The footgun is over-applying it to a whole class, which can serialize background work and freeze the.

AsyncSequence: A Sequence That Awaits Its Next Element
AsyncSequence is like a regular Swift Sequence, but you await its next element. It lets you process values that arrive over time, like network data, without blocking. The footgun: iteration suspends, so run it in a Task for true concurrency.

URLSessionDownloadTask: Download Files Without Hogging Memory
URLSessionDownloadTask downloads files directly to disk, not memory, making it ideal for large assets. Use it for videos or updates, especially in the background. The footgun: you must move the file from its temporary location or the OS will delete it.
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