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
Optionalview that is visible only when theifcondition evaluatestrue.Declaration
Swift
public static func buildIf(_ content: View?) -> OptionalView
View on GitHub
ViewBuilder Enumeration Reference