Builder
@resultBuilder
public struct Builder<Child>
Generic result builder for converting blocks of Child...
into [Child]
.
-
Declaration
Swift
public typealias Children = [Child]
-
Declaration
Swift
public static func buildExpression(_ child: Child) -> Children
-
This function is disfavored in case a builder wants to offer additional
buildExpression
functions to support multiple types in their builders.@_disfavoredOverload
allows the compiler to choose the other function whennil
is built, instead of it being ambiguous.Declaration
Swift
@_disfavoredOverload public static func buildExpression(_ child: Child?) -> Children
-
Allow for an array of
Child
to be flattened into the overall result.Declaration
Swift
public static func buildExpression(_ children: [Child]) -> Children