Builder
public struct Builder<LayoutType> where LayoutType : Layout
Used to construct elements that have layout and children.
-
The layout object that is ultimately responsible for measuring and layout tasks.
Declaration
Swift
public var layout: LayoutType -
Adds the given child element with this
SingleTraitLayout‘s trait type.Declaration
Swift
public mutating func add( traits: LayoutType.Traits, key: AnyHashable? = nil, element: Element ) where LayoutType: SingleTraitLayoutParameters
traitsThe traits to associate with this child.
keyAn optional disambiguation key. By default,
nil.elementThe child element.
-
Adds the given child element with a trait-value pair.
Declaration
Swift
public mutating func add<TraitsKey: LayoutTraitsKey>( traitsType: TraitsKey.Type, traits: TraitsKey.Value, key: AnyHashable? = nil, element: Element )Parameters
traitsTypeThe type of traits to associate with this child.
traitsThe value of the traits.
keyAn optional disambiguation key. By default,
nil.elementThe child element.
-
Adds the given child element.
Declaration
Swift
public mutating func add( traits: LayoutTraits = .empty, key: AnyHashable? = nil, element: Element )Parameters
traitsLayout traits to associate with this child. By default, no traits.
keyAn optional disambiguation key. By default,
nil.elementThe child element.
View on GitHub
Builder Structure Reference