A custom parameter attribute that constructs views from closures.
- iOS 13.0+Beta
- macOS 10.15+Beta
- UIKit for Mac 13.0+Beta
- tvOS 13.0+Beta
- watchOS 6.0+Beta
- Xcode 11.0+Beta
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: