FlashKeepers

Swift · College · College and University

SwiftUI Fundamentals

SwiftUI views, modifiers, State, Binding, Observable, lists, navigation, layout stacks and the view lifecycle.

About this set

39 basic cards for College Swift. It opens with "What does the View protocol represent in SwiftUI?" and "How do you apply a modifier to a SwiftUI view?". Study it alongside the other College sets below.

39 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What does the View protocol represent in SwiftUI?
Show answerA protocol that defines a single visual element or component that can be rendered on screen.
How do you apply a modifier to a SwiftUI view?
Show answerCall a modifier method on the view using dot notation, e.g., Text('Hello').padding()
What is the @State property wrapper used for?
Show answerTo declare a local state variable in a SwiftUI view that triggers a re-render when its value changes.
What is a VStack?
Show answerA view that arranges child views in a vertical line from top to bottom.
What does the Text view do?
Show answerDisplays a string of text on the screen.
What is the @Binding property wrapper?
Show answerA property wrapper that creates a two-way connection to a state variable from a parent view, allowing child views to read and modify it.
Why does modifier order matter in SwiftUI?
Show answerModifiers are applied sequentially, and each modifier returns a new view, so the order affects the final visual result.
What is an HStack?
Show answerA view that arranges child views in a horizontal line from left to right.
What does the padding modifier do?
Show answerAdds space around a view on all sides or on specific edges.
What is the purpose of the @StateObject property wrapper?
Show answerTo manage a reference type (Observable object) as local state in a view, creating a new instance once and persisting it across re-renders.
What is a ZStack?
Show answerA view that overlays child views on top of each other, arranged front to back along the z-axis.
What does the Observable macro do?
Show answerMarks a class as observable so that SwiftUI automatically tracks changes to its properties and re-renders dependent views.
What is a Spacer view?
Show answerA flexible view that expands to fill available space in its parent view.
What does the @Published property wrapper do?
Show answerMarks a property in an Observable class so that changes to it are automatically broadcast to dependent views.
What is NavigationStack used for?
Show answerTo manage navigation between multiple views by maintaining a stack of views and their navigation state.

24 more cards in the app

Study this set free