Skip to content
tezvyn:

iOS & Swift

SwiftUI, UIKit, Xcode, Swift language, Apple platforms

160 bites

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

Intermediate everything in iOS & Swift, page 2

intermediate1 min read

map versus compactMap versus flatMap

Map transforms each element one-to-one; compactMap transforms then drops nils; flatMap transforms to sequences then concatenates.

intermediate1 min read

dispatch_async versus Task.detached for offloading work

Dispatch_async submits a closure to a queue; Task.detached starts an unstructured async task off the current actor without inheriting context.

intermediate1 min read

What an autoreleasepool is and when to add one manually

An autorelease pool holds objects until it drains; wrap tight loops creating many temporary ObjC objects in autoreleasepool to cap peak memory.

intermediate1 min read

Exposing Swift classes to Objective-C

Subclass NSObject or mark members @objc, import the generated ModuleName-Swift.h, and accept that Swift-only types like enums with associated values cannot cross.

intermediate1 min read

Struct versus class performance and memory tradeoffs

Structs are value types, often stack-allocated with no ARC; classes are heap-allocated reference types with retain counts.

intermediate1 min read

Automatic signing: benefits and limitations on teams

Automatic signing creates certificates and profiles on demand and keeps them in sync, easing local setup; limits include proliferating certificates, weak CI fit, and less control for complex entitlements.

intermediate1 min read

Phased release to limit update risk

Enable phased release so an approved update reaches a growing percentage of automatic-update users over seven days; pause if metrics spike.

intermediate1 min read

Using dSYM files to symbolicate crash reports

A dSYM maps stripped memory addresses back to function names, files, and line numbers; matched by UUID it symbolicates the report to readable frames.

intermediate1 min read

Ad Hoc versus external TestFlight distribution

Ad hoc installs on pre-registered device UDIDs without Apple review; external TestFlight reaches many testers via the app but needs Beta App Review.

intermediate1 min read

Static library versus dynamic framework linking

Static code is copied into the executable at build time; dynamic is loaded at launch by dyld. Trade-off: static bloats the binary but avoids load cost; many dynamic frameworks slow launch.

intermediate1 min read

Modularizing a monolithic iOS app

Extract low-dependency, high-reuse leaf code first behind clear interfaces, enforce boundaries, iterate inward.

intermediate1 min read

Code coverage and its pitfalls

It measures executed lines, surfaces untested paths, and guides where to add tests.

intermediate1 min read

Locating XCUITest elements without accessibility identifiers

Query by type, label, predicate, or index; chain queries to narrow scope.

intermediate1 min read

Testing async code and completion handlers in XCTest

Create an expectation, fulfill it inside the completion handler, call wait with a timeout, or use async test methods.

intermediate1 min read

Unit test a ViewModel with a mocked NetworkService

Inject the protocol, supply a mock returning canned data, assert published state transitions.

intermediate1 min read

Display thousands of map annotations efficiently

Enable clustering via clusteringIdentifier, reuse views with dequeueReusableAnnotationView, render clusters with MKClusterAnnotation in viewFor.

intermediate1 min read

Run a Core ML image model with Vision

Add the .mlmodel so Xcode generates a class, wrap it in a VNCoreMLModel, run a VNCoreMLRequest via a VNImageRequestHandler, read results off the main queue.

intermediate1 min read

Track location continuously in the background

Set desiredAccuracy, distanceFilter, activityType; enable the Location background mode and allowsBackgroundLocationUpdates; request Always authorization.

intermediate1 min read

Allow simultaneous pan and pinch gestures

Attach pan and pinch recognizers, set yourself as delegate, return true from shouldRecognizeSimultaneouslyWith, apply translation to center and scale to transform.

intermediate1 min read

Build a custom circular progress bar in UIKit

Draw an arc with UIBezierPath, assign it to a CAShapeLayer path, set lineWidth and no fill, animate strokeEnd 0 to 1.

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