SwiftUI Cheat Sheet 2026
The 30 highest-yield SwiftUI facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
- What data type does convertedNumber have when this code is run? → Int?
- What is `TimelineView` used for in SwiftUI? → Updating a view on a schedule using a timeline schedule
- Which of the following is an example of a widely used third-party library for iOS? → AFNetwork.framework
- Which modifier controls the rendering mode of an SF Symbol image in SwiftUI? → .symbolRenderingMode()
- What is `NavigationPath` used for in iOS 16+ SwiftUI navigation? → A type-erased list of navigation destinations enabling programmatic stack control
- Which gesture type in SwiftUI is used to detect pinching motions for zooming? → MagnificationGesture
- How do you create a custom view modifier in SwiftUI? → Conform a struct to ViewModifier and implement body(content:)
- What protocol must a class conform to in order to be used with `@ObservedObject` or `@StateObject`? → ObservableObject
- What does the `delay` parameter on an animation do in SwiftUI? → Delays the start of the animation by the given time interval
- What is an LLVM, exactly? → Contains Both Compiler (swiftc And Objective C)
- What modifier enables drag-to-reorder rows in a SwiftUI List? → .onMove(perform:)
- How do you set the title shown in the navigation bar for a SwiftUI view? → Both B and C work
- Which SwiftUI modifier applies a visual effect blur to a view? → .blur(radius:)
- Which SwiftUI modifier adds a visual hover effect on supported devices without custom logic? → .hoverEffect()
- Which Swift compiler directive will cause an error to be generated? → #error
- What is the difference between `.sheet` and `.fullScreenCover` in SwiftUI? → .fullScreenCover covers the entire screen including the status bar
- How do you chain two gestures so that the second gesture only starts after the first succeeds? → firstGesture.sequenced(before: secondGesture)
- How do you add a custom transition using `AnyTransition` in SwiftUI? → Use AnyTransition.modifier(active:identity:)
- How do you add a section with a header to a SwiftUI List? → Section(header:) { rows }
- What does `@Binding` do in SwiftUI? → Creates a two-way connection to a state owned by another view
- Keywords are used to create Contants in Swift. → Let
- Which property wrapper provides edit mode state to a SwiftUI List? → @Environment(\.editMode)
- How do you conditionally show a view in SwiftUI? → if condition { view }
- What does `.phaseAnimator(_:content:animation:)` do in SwiftUI (iOS 17)? → Cycles through a sequence of phases, animating between them
- What happens to a `@State` variable when a SwiftUI view is destroyed and recreated? → It resets to its initial value
- Which SwiftUI type provides a canvas for immediate-mode drawing similar to Core Graphics? → Canvas
- What does applying `.colorMultiply(_:)` do to a SwiftUI view? → Multiplies each pixel's color by the given color
- In Swift, we can return multiple values from a function by using? → Tuple
- Which SwiftUI control presents a list of options for the user to choose from? → Picker
- How do you make List rows deletable in SwiftUI? → .onDelete(perform:) inside ForEach
Turn these facts into recall: