A custom parameter attribute that constructs views from closures.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
You typically use
View as a parameter attribute for child view-producing closure parameters, allowing those closures to provide multiple child views. For example, the following
context function accepts a closure that produces one or more views via the view builder.
Clients of this function can use multiple-statement closures to provide several child views, as shown in the following example: