Recall & Review
beginner
What is a VStack in SwiftUI?
A VStack arranges its child views vertically, one on top of another, like stacking books on a shelf.
Click to reveal answer
beginner
How does an HStack arrange views?
An HStack arranges its child views horizontally, side by side, like people standing in a line.
Click to reveal answer
beginner
What is the purpose of a ZStack?
A ZStack layers its child views on top of each other, like stacking transparent sheets, showing the topmost view last.
Click to reveal answer
intermediate
How can you control spacing between views in VStack or HStack?
You can set the spacing parameter when creating VStack or HStack to add space between the child views.
Click to reveal answer
intermediate
What happens if you put a VStack inside an HStack?
The VStack arranges views vertically inside the horizontal line created by the HStack, combining vertical and horizontal layouts.
Click to reveal answer
Which stack arranges views vertically in SwiftUI?
✗ Incorrect
VStack arranges views vertically, stacking them from top to bottom.
What does an HStack do?
✗ Incorrect
HStack arranges views side by side horizontally.
Which stack would you use to overlap views?
✗ Incorrect
ZStack layers views on top of each other, allowing overlap.
How do you add space between views in a VStack?
✗ Incorrect
The spacing parameter in VStack controls space between child views.
If you want a horizontal row with a vertical column inside it, which stacks do you combine?
✗ Incorrect
Placing a VStack inside an HStack creates a vertical column inside a horizontal row.
Explain how VStack, HStack, and ZStack differ in arranging views in SwiftUI.
Think about stacking books, lining up people, and layering transparent sheets.
You got /3 concepts.
Describe a real-life scenario where you would use a ZStack in a mobile app layout.
Imagine putting a sticky note on top of a photo.
You got /3 concepts.