LearnThatStack Ace your next interview
Mobile Development

SwiftUI & UIKit.

Start free Change topic Change
Practice · Questions

All questions

Showing of 80
Beginner 14
01

What is the View protocol in SwiftUI?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The View protocol is the fundamental building block of SwiftUI. Any struct that conforms to View must implement a computed property called body that returns some View. This represents the content and behavior of the view.

protocol View {
    associatedtype Body : View
    var body: Self.Body { get }
}

The some View return type is an opaque type that allows the compiler to determine the actual return type while hiding implementation details from the caller.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

Explain the concept of "some View" in SwiftUI.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

some View is an opaque return type introduced in Swift 5.1. It tells the compiler that the function will return a specific type that conforms to the View protocol, but the exact type doesn't need to be known by the caller.
Benefits:

  • Type Safety: The compiler knows the exact type internally
  • Performance: Enables optimizations since the type is known at compile time
  • Flexibility: You can return different view types without exposing implementation details
  • Automatic Type Inference: The compiler figures out the return type automatically
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What are property wrappers in SwiftUI and why are they important?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Property wrappers are a Swift feature extensively used in SwiftUI to manage state and data flow. They provide a clean syntax for adding behavior to properties without cluttering the property declaration.
Common SwiftUI property wrappers:

  • @State: For local view state
  • @Binding: For two-way data binding
  • @ObservedObject: For external observable objects
  • @StateObject: For object ownership
  • @EnvironmentObject: For dependency injection
struct CounterView: View {
    @State private var count = 0  // Property wrapper
    var body: some View {
        Text("Count: \(count)")
    }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What is @State and when should you use it?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

@State is a property wrapper for managing local, private state within a view. It should be used for simple value types that are owned and managed by the view itself.
Key characteristics:

  • Local: State belongs to the view
  • Private: Should be marked private
  • Value Types: Works with structs, enums, and basic types
  • Automatic UI Updates: SwiftUI automatically redraws the view when state changes
struct ToggleView: View {
    @State private var isOn = false
    var body: some View {
        Toggle("Switch", isOn: $isOn)
    }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

Explain the difference between VStack, HStack, and ZStack.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

These are fundamental layout containers in SwiftUI:
VStack: Arranges views vertically (top to bottom)
HStack: Arranges views horizontally (left to right)
ZStack: Layers views on top of each other (back to front)

VStack {           // Vertical stack
    Text("Top")
    Text("Bottom")
}
HStack {           // Horizontal stack
    Text("Left")
    Text("Right")
}
ZStack {           // Layered stack
    Circle().fill(Color.blue)
    Text("Overlay")
}

Each can take alignment and spacing parameters to control layout behavior.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

How does navigation work in SwiftUI?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

SwiftUI provides several navigation mechanisms:
NavigationView/NavigationStack (iOS 16+):

NavigationView {
    List {
        NavigationLink("Detail", destination: DetailView())
    }
    .navigationTitle("Main")
}

Sheet Presentation:

@State private var showingSheet = false
Button("Show Sheet") {
    showingSheet = true
}
.sheet(isPresented: $showingSheet) {
    DetailView()
}

Alert and ActionSheet:

.alert("Error", isPresented: $showingAlert) {
    Button("OK") { }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

How do you create and customize Lists in SwiftUI?

Part of Pro
08

What is the difference between List and ScrollView?

Part of Pro
09

What is the difference between UIView and UIViewController?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

UIView is the fundamental building block for all visual elements in iOS. It represents a rectangular area on the screen and handles drawing and user interaction within that area. Views can contain other views (subviews) and form a view hierarchy.

UIViewController manages a collection of views and coordinates the logic between the model and view layers. It handles view lifecycle events, user interactions, and navigation between different screens.

// UIView - represents visual element
let myView = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
myView.backgroundColor = .blue

// UIViewController - manages views and logic
class MyViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(myView)
    }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

10

Explain the view hierarchy in UiKit.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The view hierarchy is a tree-like structure where views contain other views as subviews. Each view has a superview (parent) and can have multiple subviews (children). The root view is typically managed by a view controller.

Key characteristics:

  • Child views are drawn on top of their parent views
  • Coordinate systems are relative to the superview
  • Events bubble up through the hierarchy
  • Views inherit certain properties from their superviews
let parentView = UIView()
let childView1 = UIView()
let childView2 = UIView()

parentView.addSubview(childView1)
parentView.addSubview(childView2)
// childView2 will be drawn on top of childView1
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

11

What are the main properties of UIView?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Key UIView properties include:

  • frame: Position and size in superview's coordinate system
  • bounds: Internal coordinate system (always origin at 0,0)
  • center: Center point in superview coordinates
  • backgroundColor: Background color of the view
  • alpha: Transparency level (0.0 to 1.0)
  • isHidden: Visibility state
  • tag: Integer identifier for finding views
  • superview: Parent view reference
  • subviews: Array of child views
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

12

What is Auto Layout and why is it important?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Auto Layout is a constraint-based layout system that automatically calculates the size and position of views based on rules (constraints) you define. It's important because:

  • Responsive Design: Adapts to different screen sizes and orientations
  • Dynamic Content: Handles varying content sizes automatically
  • Internationalization: Supports different languages and text directions
  • Accessibility: Works with Dynamic Type and accessibility features

Auto Layout uses mathematical relationships between views instead of fixed frames, making UIs flexible and maintainable.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

13

Explain the difference between UITableView and UICollectionView.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

UITableView displays data in a single column of rows. It's optimized for vertical scrolling and is ideal for lists, settings screens, and hierarchical data.

UICollectionView displays data in a customizable grid layout. It supports multiple columns, horizontal scrolling, and complex layouts like grids, carousels, or custom arrangements.

Key differences:

  • TableView: Single column, vertical scrolling, simpler implementation
  • CollectionView: Multiple columns, any scroll direction, more flexible but complex
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

14

What is UINavigationController and how does it work?

Part of Pro
Intermediate 50
15

Explain the difference between @State and @StateObject.

Part of Pro
16

What is @Binding and how does it work?

Part of Pro
17

When should you use @ObservedObject vs @StateObject?

Part of Pro
18

What is @EnvironmentObject and when is it useful?

Part of Pro
19

How does data flow work in SwiftUI?

Part of Pro
20

What is the difference between a View and a ViewBuilder?

Part of Pro
21

How do you handle different screen sizes and orientations in SwiftUI?

Part of Pro
22

What is GeometryReader and when should you use it?

Part of Pro
23

What's the difference between sheet, fullScreenCover, and popover?

Part of Pro
24

How do you pass data back from a presented view?

Part of Pro
25

When should you use LazyVStack vs VStack?

Part of Pro
26

How do you implement pull-to-refresh in SwiftUI?

Part of Pro
27

How do view modifiers work in SwiftUI and what is modifier order importance?

Part of Pro
28

What are some ways to apply conditional modifiers?

Part of Pro
29

How do you create custom view modifiers?

Part of Pro
30

How do animations work in SwiftUI?

Part of Pro
31

What's the difference between implicit and explicit animations?

Part of Pro
32

How do you create reusable custom views?

Part of Pro
33

What is the difference between creating a computed property vs a separate View struct?

Part of Pro
34

What are some best practices for SwiftUI performance?

Part of Pro
35

What causes unnecessary view updates and how do you prevent them?

Part of Pro
36

How do you implement MVVM in SwiftUI?

Part of Pro
37

How do you integrate UIKit views into SwiftUI?

Part of Pro
38

How do you integrate SwiftUI views into existing UIKit apps?

Part of Pro
39

What are the limitations of SwiftUI compared to UIKit?

Part of Pro
40

What is the difference between frame and bounds?

Part of Pro
41

Describe the view controller lifecycle methods and their purposes.

Part of Pro
42

When would you use viewWillAppear vs viewDidLoad?

Part of Pro
43

What is the purpose of loadView() and when should you override it?

Part of Pro
44

What are the different types of constraints in Auto Layout?

Part of Pro
45

What is content hugging and compression resistance priority?

Part of Pro
46

How do you resolve Auto Layout conflicts?

Part of Pro
47

What is intrinsic content size?

Part of Pro
48

What is cell reuse and why is it important?

Part of Pro
49

How do you implement a custom table view cell?

Part of Pro
50

What are the required and optional methods of UITableViewDataSource?

Part of Pro
51

How do you implement swipe actions in a table view?

Part of Pro
52

How do you pass data between view controllers?

Part of Pro
53

What is the difference between modal presentation and navigation?

Part of Pro
54

What are the different modal presentation styles?

Part of Pro
55

What are gesture recognizers and how do you use them?

Part of Pro
56

How do you handle multiple gesture recognizers on the same view?

Part of Pro
57

How do you create basic animations in UiKit?

Part of Pro
58

What properties can be animated with UIView animations?

Part of Pro
59

How do you create a custom view with custom drawing?

Part of Pro
60

When should you use drawRect vs adding subviews?

Part of Pro
61

What are the pros and cons of Interface Builder vs programmatic UI?

Part of Pro
62

How do you create UI elements programmatically?

Part of Pro
63

How do you handle memory warnings in view controllers?

Part of Pro
64

How do you implement Dark Mode support in UiKit?

Part of Pro
Expert 16
65

How do you create custom transitions?

Part of Pro
66

How do you create a view that conforms to multiple protocols?

Part of Pro
67

How does SwiftUI's diffing algorithm work?

Part of Pro
68

How do you handle dependency injection in SwiftUI?

Part of Pro
69

How do you implement custom drawing and shapes in SwiftUI?

Part of Pro
70

How do you implement complex gesture recognition?

Part of Pro
71

How do you handle async operations and error handling in SwiftUI?

Part of Pro
72

How do you test SwiftUI views?

Part of Pro
73

What is the responder chain and how does touch handling work?

Part of Pro
74

What is the difference between UIView animations and Core Animation?

Part of Pro
75

How does memory management work with view controllers and strong reference cycles?

Part of Pro
76

What are some best practices for UiKit performance optimization?

Part of Pro
77

What are size classes and how do you use them for adaptive layouts?

Part of Pro
78

What is UIKit Dynamics and when would you use it?

Part of Pro
79

How do you implement accessibility in UiKit applications?

Part of Pro
80

What are some common UiKit design patterns and when to use them?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for SwiftUI & UIKit? Send them this set.
Pro · $10/mo

69 of 80 SwiftUI & UIKit answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git