Skip to content
tezvyn:

iOS & Swift

SwiftUI, UIKit, Xcode, Swift language, Apple platforms

93 bites

Test yourself: Top 30 intermediate iOS & Swift concepts questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Intermediate concepts in iOS & Swift

intermediate2 min read

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.

intermediate2 min read

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.

intermediate2 min read

Swift Enums: Type-Safe Choice Modeling

A Swift enum is a closed menu of possibilities the compiler tracks exhaustively. Use it to replace string constants or model a network result state. Adding a case without updating every switch breaks compile-time safety if you rely on a default clause.

intermediate2 min read

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.

intermediate2 min read

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.

intermediate2 min read

Copy-on-Write (CoW) in Swift

Copy-on-write lets Swift's Array, Dictionary, Set, and String share one underlying buffer across copies until one is mutated, giving full value-type semantics with the performance of sharing, deferring the actual copy until it is truly needed.

intermediate2 min read

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.

Key-Path Expressions: Type-Safe Pointers to Properties
intermediate2 min read

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.

intermediate2 min read

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.

Xcode Schemes vs. Build Configurations
intermediate2 min read

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.

Auto Layout: Describing Relationships, Not Frames
intermediate2 min read

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.

intermediate2 min read

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.

Xcode View Debugger: Uncover Hidden UI Bugs
intermediate2 min read

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.

Swift Package Manager: Native Dependency Management
intermediate2 min read

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.

UITableView: The Backbone of iOS Lists
intermediate2 min read

UITableView: The Backbone of iOS Lists

UITableView is the workhorse for displaying scrolling lists in iOS. It's used everywhere from Settings to Contacts. The footgun is forgetting to reuse cells, which causes massive memory usage and choppy scrolling, so always dequeue a reusable cell.

UICollectionView: Grids, Stacks, and Custom Layouts
intermediate1 min read

UICollectionView: Grids, Stacks, and Custom Layouts

UICollectionView is a powerful tool for displaying items in customizable layouts, going far beyond a simple vertical list. Use it for photo galleries or App Store-style interfaces.

SwiftUI State and Binding: Owning vs. Sharing Data
intermediate2 min read

SwiftUI State and Binding: Owning vs. Sharing Data

In SwiftUI, @State is owning the data, while @Binding is borrowing a key. A view uses @State for its private source of truth, like a toggle's status, and passes a @Binding to child views so they can modify the original source.

SwiftUI Modifiers: Stacking Changes on Views
intermediate2 min read

SwiftUI Modifiers: Stacking Changes on Views

Think of SwiftUI modifiers as non-destructive filters you apply to a view, creating a new, wrapped version with the change applied. You use them to add padding, set fonts, or handle taps. The footgun: modifier order matters immensely.

SwiftUI List: More Than Just a Table View
intermediate2 min read

SwiftUI List: More Than Just a Table View

A SwiftUI List is a declarative container for scrollable rows of data, like a modern UITableView. Use it for settings, feeds, or contact lists. The footgun: never nest a List inside a ScrollView, as it breaks scrolling behavior.

UIHostingController: Bridge SwiftUI into UIKit Apps
intermediate1 min read

UIHostingController: Bridge SwiftUI into UIKit Apps

UIHostingController is an adapter that lets you use modern SwiftUI views inside a UIKit app by wrapping them in a UIViewController. This is key for migrating apps to SwiftUI or embedding new components.

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