ViewBuilder & Generic Containers
Accept arbitrary content with @ViewBuilder.
Containers That Hold Anything
VStack and List accept whatever views you nest inside them. You can build your own container that holds arbitrary content too. 📦
What @ViewBuilder Does
The @ViewBuilder attribute lets a closure list several views without commas or arrays. It is the magic behind stacks.
VStack {
Text("One")
Text("Two")
}All lessons in this course
- Extracting Reusable Views
- Custom ViewModifiers
- ButtonStyle & LabelStyle
- ViewBuilder & Generic Containers