Skip to content
tezvyn:

iOS & Swift

SwiftUI, UIKit, Xcode, Swift language, Apple platforms

310 bites

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

Everything in iOS & Swift, page 3

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.

easy1 min read

Package.swift manifest: library vs executable products

The manifest declares name, targets, dependencies, and products; a library is consumed by other code while an executable produces a runnable binary with an entry point.

easy1 min read

Adding a Swift Package dependency in Xcode

Add via File menu, paste the repo URL, choose a version rule like up-to-next-major, link the product to your target.

advanced1 min read

Driving app state via launch arguments in XCUITest

Pass launchArguments and launchEnvironment, read them at startup to seed auth and flags, bypassing slow UI steps.

advanced1 min read

Diagnosing and stabilizing flaky XCUITests

Identify timing races, animations, network variance, and shared state; fix with expectations, controlled launch state, and isolation.

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.

easy2 min read

Unit test versus UI test in Xcode

Unit tests (XCTest) exercise code logic in-process and fast; UI tests (XCUITest) drive the app through the accessibility layer, slower and end-to-end.

advanced2 min read

Recognize objects in ARKit with a Core ML model

Pull the frame's capturedImage, run Vision/Core ML off the main thread, raycast the 2D detection point into the scene, add an ARAnchor.

advanced1 min read

React to location authorization changed in Settings

Implement locationManagerDidChangeAuthorization, which fires on launch and whenever status changes, read authorizationStatus, and start updates when authorized.

advanced1 min read

Apply a CIFilter to a live camera feed

Use AVCaptureSession with AVCaptureVideoDataOutput, receive CMSampleBuffers in captureOutput via the sample buffer delegate on a serial queue, filter with CIImage, drop late frames.

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.

easy1 min read

Play a remote video with AVFoundation

Wrap the URL in AVPlayerItem, feed it to AVPlayer, render with AVPlayerLayer added to the view's layer (or AVPlayerViewController for controls).

easy1 min read

Request the user's location one time

Add a usage description to Info.plist, set a CLLocationManager delegate, request when-in-use authorization, call requestLocation, handle didUpdateLocations and didFailWithError.

advanced1 min read

Animate a SwiftUI Shape morphing point count

Expose a continuous sides value as animatableData so SwiftUI interpolates it, then compute the path from that fractional value each frame.

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