🌍 Mobile App Development · flashcards
Mobile App Development Native iOS Development Flashcards
51 question-and-answer cards covering Native iOS Development as it is examined in Mobile App Development. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.
24 sample cards from the Native iOS Development deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
Compare UITableView and UICollectionView.
UITableView shows a single-column vertical list of rows grouped into sections. UICollectionView supports arbitrary layouts (grids, flow, custom, compositional) via a layout object, generalizing tables to two-dimensional arrangements.
Why do UITableView and UICollectionView reuse cells, and which method provides a recycled cell?
Reuse avoids allocating a cell for every item, keeping memory and scrolling performance bounded to on-screen cells. `dequeueReusableCell(withIdentifier:for:)` returns a recycled (or newly created) cell.
In a UITableView data source, what do `numberOfRowsInSection` and `cellForRowAt` each return?
`numberOfRowsInSection` returns the count of rows for a given section. `cellForRowAt` returns the configured `UITableViewCell` for a specific index path.
What is a modern Diffable Data Source and what problem does it solve?
`UITableViewDiffableDataSource` / `UICollectionViewDiffableDataSource` drive updates from immutable snapshots of sections and item identifiers, computing and animating differences automatically, eliminating manual `insert/delete` batch-update crashes from inconsistent counts.
How do you embed a SwiftUI view inside a UIKit view controller?
Wrap the SwiftUI view in a `UIHostingController` and add that controller as a child view controller (or use its `.view`).
How do you embed a UIKit view or view controller inside SwiftUI?
Conform a struct to `UIViewRepresentable` (for a UIView) or `UIViewControllerRepresentable` (for a UIViewController), implementing the make/update methods and optionally a Coordinator for delegation.
In UIViewRepresentable, what is the role of the Coordinator?
The Coordinator is an object that acts as delegate/data source or target-action handler for the wrapped UIKit view, bridging UIKit callbacks back into SwiftUI state.
What is the basic sequence to perform a GET request with URLSession using completion handlers?
Create a `URL`, build a `URLRequest` (or use the URL directly), call `URLSession.shared.dataTask(with:) { data, response, error in ... }`, then call `.resume()` to start the task.
In URLSession, why must you call `.resume()` on a data task?
Tasks are created in a suspended state; `.resume()` starts execution. Forgetting it means the network request never fires.
What is the async/await equivalent of a URLSession data task, and what does it return?
`let (data, response) = try await URLSession.shared.data(from: url)` (or `data(for: request)`), returning a tuple of the response body `Data` and the `URLResponse`.
In Swift concurrency, what is the difference between `async let` and a `TaskGroup`?
`async let` binds a fixed, statically known number of concurrent child tasks awaited later. A `TaskGroup` spawns a dynamic number of child tasks (e.g. in a loop) and collects their results, all with structured lifetimes.
What does the `@MainActor` attribute guarantee?
It guarantees the annotated code (property, method, or type) runs on the main thread/main actor, which is required for updating UIKit/SwiftUI UI.
In structured concurrency, what does it mean that child tasks have bounded lifetimes?
A parent task cannot complete until all its child tasks have finished (or been cancelled), so task lifetimes are nested within the enclosing scope, preventing leaked or orphaned work.
What is the difference between `Task { }` and `Task.detached { }`?
`Task { }` inherits the current actor context, priority, and task-local values. `Task.detached { }` creates an unstructured task with no inherited context, running independently of the enclosing scope.
In the Combine framework, what are a Publisher and a Subscriber?
A Publisher emits a sequence of values over time along with a completion or failure. A Subscriber receives those values and the terminal event; `sink` and `assign` are common subscribers.
In Combine, what is the role of an operator, and give two examples.
An operator transforms, filters, or combines values in a publisher chain, returning a new publisher. Examples: `map` (transform each value) and `filter` (drop values failing a predicate); others include `debounce` and `combineLatest`.
In Combine, why is `AnyCancellable` important?
Subscribing (via `sink`/`assign`) returns an `AnyCancellable`; you must retain it (e.g. in a `Set<AnyCancellable>`) or the subscription is cancelled and deallocated immediately.
In Swift's Codable, what is the difference between Encodable and Decodable?
`Encodable` lets a type serialize itself to an external format (e.g. JSON). `Decodable` lets a type be created from external data. `Codable` is the typealias `Encodable & Decodable`.
How do you decode a JSON payload into a Codable struct, and how do you map differing JSON key names?
Use `try JSONDecoder().decode(MyType.self, from: data)`. Map differing names either with a `CodingKeys` enum or by setting `decoder.keyDecodingStrategy = .convertFromSnakeCase`.
In JSONDecoder, what does `dateDecodingStrategy` control and name a common value?
It controls how JSON date values are parsed into `Date`. Common values include `.iso8601`, `.secondsSince1970`, `.millisecondsSince1970`, and `.formatted(_:)`.
What is UserDefaults appropriate for, and what should it NOT store?
UserDefaults stores small amounts of lightweight user preferences and settings as a property list. It should not store large data or sensitive secrets (it is not encrypted).
Why use the Keychain instead of UserDefaults for storing passwords or tokens?
The Keychain is an encrypted, access-controlled secure store backed by the Secure Enclave/hardware, whereas UserDefaults is stored in plaintext in the app container and is not secure for credentials.
In Core Data, what are the roles of NSManagedObjectContext and NSPersistentContainer?
`NSManagedObjectContext` is the in-memory scratchpad where you create, fetch, modify, and delete managed objects and then `save()`. `NSPersistentContainer` sets up the whole Core Data stack (model, coordinator, store, and a main-thread viewContext).
In Core Data, what is an NSFetchRequest and how do you constrain and order its results?
An `NSFetchRequest` describes a query for a given entity. You constrain results with an `NSPredicate` and order them with an array of `NSSortDescriptor` objects.
What this deck covers
The Native iOS Development deck follows the Mobile App Development Native iOS Development syllabus — 6 chapters and 24 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 8.5 cards per chapter.
Answers are written to be recallable, not just readable — averaging about 186 characters, which is long enough to carry the reasoning and short enough to say out loud.
A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.
Native iOS Development flashcards FAQ
How many Native iOS Development flashcards are in this Mobile App Development deck?
51 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.
Are these Mobile App Development flashcards free?
Yes. The preview here is free to read with no signup, and the full 51-card deck is free inside the Examius app.
What do the Native iOS Development cards cover?
They follow the Mobile App Development Native iOS Development syllabus — 6 chapters and 24 topics — so the questions track what is actually examinable.
How should I use these flashcards?
Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.