Skip to content
tezvyn:

Uikit

44 bites tagged Uikit — interview questions with model answers, and 60-second explainers.

iOS & Swift1 min read

Push vs Modal Presentation in UIKit

Push adds to a nav stack with back, modal presents a self-contained interrupting flow. understanding of UIKit navigation models. treating them as interchangeable or ignoring the stack relationship.

iOS & Swift1 min read

IBOutlet vs IBAction in Interface Builder

Outlet references a view, action handles an event, both connect via Ctrl-drag. grasp of Storyboard-to-code wiring. confusing the two directions or forgetting the connection is runtime, not compile-time.

iOS & Swift1 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). Knowing the AVPlayer rendering stack.

iOS & Swift1 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… The custom transition protocol stack.

iOS & Swift1 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. Simultaneous gesture recognition via the delegate.

iOS & Swift1 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. Vector drawing with CAShapeLayer plus strokeEnd animation.

iOS & Swift1 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. Coordinate systems and transform effects.

iOS & Swift1 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. CALayer shadow and corner properties plus the masksToBounds conflict.

iOS & Swift1 min read

Explain UIKit MVC and the Massive View Controller problem

Model holds data, View displays it, Controller mediates between them; the view controller accretes networking, parsing, and logic into a Massive View Controller. understanding UIKit's core pattern and its pitfall.

iOS & Swift1 min read

Describe the iOS app lifecycle and SceneDelegate methods

Not running, inactive, active, background, suspended; SceneDelegate handles sceneDidBecomeActive, sceneWillResignActive, sceneDidEnterBackground, sceneWillEnterForeground. knowledge of app and scene states.

iOS & Swift1 min read

How does Auto Layout resolve constraints?

Auto Layout solves a system of prioritized linear equations; intrinsicContentSize is a view's natural size; hugging resists growing, compression resistance resists shrinking. understanding constraint-based layout.

iOS & Swift2 min read

Design state-driven navigation for a conditional wizard in UIKit and SwiftUI

This tests separating navigation state from UI. Model the flow as a state machine enum, derive the stack from state, and unit test transitions in plain Swift. A red flag is imperative pushes inside views or view controllers.

iOS & Swift2 min read

How would you architect the app root for onboarding vs authenticated flows?

Tests window root swapping and state-driven architecture. Use a coordinator to own the window, swap rootViewController between nav and tab controllers on auth changes, and crossfade. Red flag: onboarding modal over tabs or keeping both hierarchies alive.

iOS & Swift2 min read

Handle a deep link URL in SceneDelegate and navigate to order detail.

Handles willConnectTo and openURLContexts; parses path with URLComponents; validates ID; pushes detail onto nav stack. iOS scene-based deep links. Forgetting warm launches or routing without checking view hierarchy.

iOS & Swift2 min read

Pass data back from a modally presented view controller delegate versus closure

This tests decoupled UIKit communication and memory safety. A strong answer outlines a weak delegate protocol and a closure with weak self, contrasting coupling and retain cycles. Red flag: singletons or direct parent references.

iOS & Swift2 min read

Outline the key steps and APIs for State Preservation and Restoration

Tests UIKit's automatic state restoration pipeline. Strong answers cover: opting in via AppDelegate, setting restorationIdentifiers, implementing encode/decodeRestorableStateWithCoder, and the system snapshot cycle.

iOS & Swift2 min read

How does the Coordinator pattern decouple navigation, and what are its components?

This tests iOS separation of concerns. Explain that Coordinators extract navigation logic from view controllers for reuse, and describe AppCoordinator tree with child coordinators. A red flag is treating it as a router or ignoring parent-child retention.

iOS & Swift2 min read

How do AppDelegate and SceneDelegate responsibilities differ?

AppDelegate owns process events (launch, push); SceneDelegate owns per-window lifecycle and UI. iOS 13 scene architecture mastery. Putting all UI logic in AppDelegate or claiming SceneDelegate is optional.

iOS & Swift2 min read

Integrate SwiftUI into UIKit and wrap UIKit for SwiftUI

Tests bridging architecture between UIKit and SwiftUI using UIHostingController and UIViewRepresentable. A strong answer names hosting controllers for SwiftUI in UIKit, representable protocols for UIKit in SwiftUI, and lifecycle hooks.

iOS & Swift2 min read

Compare UIKit Auto Layout and SwiftUI layout systems

Tests imperative versus declarative layout paradigms. Contrast UIKit's constraint solver with SwiftUI's two-pass sizing and composition via stacks and modifiers instead of anchors. Red flag: claiming SwiftUI uses Auto Layout under the hood.

iOS & Swift2 min read

How do UITableView and UICollectionView reuse cells?

This tests your understanding of UIKit's flyweight pattern and scroll performance. A strong answer covers the reuse pool, dequeueReusableCell mapping identifiers to new index paths, and registration.

iOS & Swift2 min read

When should you use frame-based layout versus Auto Layout?

Frames suit static or high-frequency UI like particle systems; Auto Layout handles rotation, Dynamic Type, localization, and split screen. When manual frames beat constraints. Claiming Auto Layout always wins.

iOS & Swift2 min read

Explain symbolic breakpoints and debug Auto Layout with one

Tests debugging closed-source frameworks without source lines. A strong answer says a symbolic breakpoint stops on UIViewAlertForUnsatisfiableConstraints, then checks the backtrace or log to find the bad view.

iOS & Swift2 min read

Custom Rendering with draw(_:)

draw(_:) is the callback where UIKit asks your view for pixels. Override it to render custom shapes or text with Core Graphics when stock views fall short. The footgun is calling it directly or doing non-drawing work inside; use setNeedsDisplay() instead.

Get Uikit bites daily.

Five a day, five minutes, offline. With quizzes so it sticks.

Open testing — you’ll join as an early tester.