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

What protocol does a class need to conform to in order to be used with @StateObject or @ObservedObject?

In this round
  1. What protocol does a class need to conform to in order to be used with @StateObject or @ObservedObject?
  2. What is the basic difference between the implicit .animation(_:value:) modifier and withAnimation?
  3. What do VStack, HStack, and ZStack arrange their children as, respectively?
  4. What is NavigationStack used for?
  5. What does ForEach do inside a SwiftUI view?
  6. What is the purpose of .navigationDestination(for:) on a NavigationStack's content?
  7. What does Spacer() do inside an HStack or VStack?
  8. Why are SwiftUI views typically declared as structs instead of classes?
  9. What is .transition() used for on a SwiftUI view?
  10. Why does the body property typically have the return type `some View` instead of a concrete type like VStack?
  11. What does withAnimation do when wrapped around a state mutation?
  12. What replaced NavigationView as the recommended navigation container in modern SwiftUI?
Gaps to close?
Read the curated SwiftUI notes — core concepts, patterns, interview prep.
SwiftUI notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web