ViewBuilder
@_functionBuilder
public enum ViewBuilder
A parameter and function attribute that can specify multiple views in the form of a closure.
ViewBuilder is used when passing children views as parameter to a parent view.
-
Declaration
Swift
public static func buildBlock() -> EmptyView
-
Provides support for “if” statements in multi-statement closures, producing an
Optional
view that is visible only when theif
condition evaluatestrue
.Declaration
Swift
public static func buildIf(_ content: View?) -> OptionalView