IOS
317 bites tagged IOS — interview questions with model answers, and 60-second explainers.
Xcode's Time Profiler: Hunting Down Performance Bottlenecks
Time Profiler is a stopwatch for your code, sampling your app's threads to see which functions are running most often. Use it to diagnose slow UI or high battery drain by finding CPU "hot spots."
iOS Provisioning Profiles: Your App's Passport
A provisioning profile is a passport for your iOS app, bundling who can run it (devices), what it can do (entitlements), and who built it (certificate). It's required for running on physical devices and is a common source of build errors.
Swift Package Manager: Native Dependency Management
Swift Package Manager (SPM) is Apple's built-in librarian for your project's code dependencies. You use it to add, remove, and update third-party libraries directly in Xcode. The main footgun is that version conflicts between dependencies can break your build.
Xcode View Debugger: Uncover Hidden UI Bugs
The View Debugger is like an X-ray for your UI, showing every view and constraint in a 3D stack. Use it to find clipped labels, missing views, or un-tappable buttons. The common footgun is forgetting that invisible views can still block user input.
LLDB: Stop Time with Breakpoints
A breakpoint is a red light for your code, pausing execution at a specific line so you can inspect your program's state. In Xcode, use it to freeze your app when a bug occurs, examine variables, and step through code.
Auto Layout: Describing Relationships, Not Frames
Auto Layout lets you describe a UI by its relationships, not hardcoded coordinates. You declare "this button is centered and 8 points below the logo," and the system calculates its position.
Xcode Schemes vs. Build Configurations
Schemes are *what* you build (the target and action), while Configurations are *how* you build (the settings). Use them to manage environments like Debug vs. Release, each with its own API keys. The footgun is putting environment settings directly in a Scheme.
Asset Catalogs: Your App's Smart Media Library
An Asset Catalog is a smart folder for your app's visuals, automatically serving the right version (like high-res or dark mode) for the user's device. It's the standard way to manage images, icons, and colors in Xcode.
Interface Builder: Visual UI Design for iOS/macOS
Interface Builder is Xcode's visual editor for building UIs. You drag-and-drop components like buttons and screens, which are saved as `.xib` files. It's used to quickly lay out app screens without writing UI code.
Xcode Project: Your App's Blueprint and Toolbox
An Xcode project is a self-contained kit for your app, holding all files, assets, and build instructions. It's the central repository for source code, build settings, and dependencies. The footgun: moving files in Finder without telling Xcode breaks builds.
Opaque Types: Hide Implementation, Not Capabilities
Opaque types (`some Protocol`) hide a function's concrete return type, exposing only its protocol conformance. This lets you change the implementation later (e.g., from `ReverseCollection`) without breaking client code that just needs `some Collection`.
Key-Path Expressions: Type-Safe Pointers to Properties
A key path is a type-safe "pointer" to a property, like `\User.name`. It lets you pass around a reference to a property itself, not just its value, making it ideal for generic sorting or SwiftUI data binding. The footgun is forgetting they are strictly typed.
Associated Types: Making Protocols Generic
Associated types make protocols generic. Think of them as a "fill-in-the-blank" type name. A protocol like `Sequence` has an `Element` type, which a conforming `Array<String>` fills in as `String`.
Retain Cycles and Capture Lists in Swift
A retain cycle is a memory leak where two objects hold strong references to each other, preventing deallocation. This often happens in closures that capture `self`, like network callbacks.
Protocol Extensions: Default Behavior for Free
Protocol extensions give conforming types default functionality "for free," like a standard toolkit with every blueprint. Use them to add common behavior to your protocols or even extend system types.
The Result Type: Modeling Success and Failure
The Result type is a sealed box for an operation's outcome: it holds either a success value or a failure error. It's used in asynchronous code like network requests to create clean, explicit completion handlers. The footgun is forgetting to handle both cases.
Value vs. Reference Semantics in Swift
Value types are like emailing a document copy; changes don't affect the original. Reference types are like a shared Google Doc link; everyone edits the same instance. In Swift, `structs` are copies, while `classes` are shared references.
async/await: Write Concurrent Code That Reads Synchronously
async/await lets you write asynchronous code that reads like a synchronous story, eliminating callback hell. It's ideal for network requests or file I/O. The footgun is thinking `await` blocks a thread; it only suspends the current task.
Automatic Reference Counting (ARC): Swift's Memory Manager
ARC is Swift's automatic memory manager for classes. It's like a landlord tracking tenants: when the last reference to an object is gone, its memory is freed. It's used everywhere in Swift, but the footgun is creating strong reference cycles.
Protocols: Swift's Blueprint for Behavior
Protocols are Swift's blueprints for behavior, enabling composition over inheritance. They're used to decouple dependencies and define shared functionality like `Codable`. The footgun is mistaking `any Protocol` for `some Protocol`, inviting performance costs.
Swift Error Handling: Throwing, Catching, and Propagating
Swift error handling uses a dedicated channel for failures. Functions declare they can fail with `throws`, you handle them with `do-catch`, or transform them into optionals with `try?`. The footgun is overusing `try!`, which crashes your app on failure.
Swift Structs vs. Classes: Value vs. Reference Types
In Swift, a struct is a copied value (like a new document), while a class is a shared reference (like a link to one document). Use structs for simple data like coordinates; use classes for shared state like a user session.
Swift Optionals: Handling Nothing Safely
An Optional is like a box that might contain a value or might be empty (`nil`). You must safely unwrap it before using the value, preventing crashes. It's used for properties that might not exist yet or for function returns that can fail.
Swift Control Flow: Directing Your Code's Path
Control flow statements are the traffic signals of your code. They use keywords like `if`, `for`, and `switch` to make decisions and repeat actions, rather than just running top-to-bottom. This is how you show a list of items or check if a user is logged.
Get IOS bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.