Skip to content
tezvyn:

iOS & Swift

SwiftUI, UIKit, Xcode, Swift language, Apple platforms

129 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.

Interview questions in iOS & Swift, page 4

intermediate1 min read

Add a default header to every URLSession request

Set httpAdditionalHeaders on a URLSessionConfiguration, build the session from it, mention per-request overrides win.

advanced1 min read

How task cancellation works with async/await

Cancellation is a flag, not a kill; check Task.isCancelled or call checkCancellation, URLSession throws CancellationError automatically.

advanced1 min read

What is an actor and how does it prevent data races

Actors serialize access to mutable state, reachable only via await; compiler blocks unsafe access. Token-refresh actor coalesces concurrent refreshes.

easy1 min read

Implicit .animation() vs explicit withAnimation

.animation(value:) animates a view when a tracked value changes; withAnimation wraps the state mutation so all dependent views animate.

easy1 min read

Add shadow and rounded corners to a UIView

CornerRadius needs masksToBounds true, but that clips the shadow; set shadowPath to keep both and stay performant.

intermediate1 min read

Difference between frame, bounds, and center

Frame and center are in the superview's space; bounds is the view's own space, usually origin zero. A non-identity transform makes frame undefined to read.

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.

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.

advanced1 min read

Diagnose dropped frames during animation

Use Core Animation and color-debug options to spot off-screen passes, blending, and overdraw; cache, flatten, and set shadowPath.

advanced1 min read

Build an interruptible custom VC transition

A delegate vends an animator (UIViewControllerAnimatedTransitioning) for the visuals and an interactive controller (UIViewControllerInteractiveTransitioning) driven by a pan to scrub progress and…

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.

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.

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).

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

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

Display thousands of map annotations efficiently

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

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.

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.

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.

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.

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