All quizzes
Free quiz · 50 questions in the bank

SwiftUI quiz

Test your SwiftUI knowledge with a free interactive quiz — 50 questions with answers and explanations. No signup needed to play.

Question 1/12Score 0

Why does the body property typically have the return type `some View` instead of a concrete type like VStack?

In this round
  1. Why does the body property typically have the return type `some View` instead of a concrete type like VStack?
  2. What do VStack, HStack, and ZStack arrange their children as, respectively?
  3. What does a basic NavigationLink do inside a NavigationStack?
  4. What does @EnvironmentObject do?
  5. What replaced NavigationView as the recommended navigation container in modern SwiftUI?
  6. What does marking a property @Published inside an ObservableObject do?
  7. What does GeometryReader provide to its content closure?
  8. What is the purpose of .navigationDestination(for:) on a NavigationStack's content?
  9. What is the single requirement of the SwiftUI View protocol?
  10. What does the .padding() modifier do?
  11. What does Spacer() do inside an HStack or VStack?
  12. What is the main benefit of breaking a large screen into several small subviews in SwiftUI?
Gaps to close?
Read the curated SwiftUI notes — core concepts, patterns, interview prep.
SwiftUI notes

More quizzes

.NETAccessibilityAgile MethodologyAlertmanagerAlgorithmsAndroid