EqualStack
public struct EqualStack : Element
An element that sizes its children equally, stacking them in the primary axis according to
the specified direction
and spacing them according to the specified spacing
. In the
secondary axis, children are justified to fill the space of the largest child.
Note
A stack measures itself by determining its largest child in each axis, and in the case of the primary axis, multiplying bychildren.count
(accounting
for spacing
as necessary).
-
The direction in which this element will stack its children.
Declaration
Swift
public var direction: Direction
-
The amount of space between children in this element. Defaults to 0.
Declaration
Swift
public var spacing: CGFloat
-
The child elements to be laid out. Defaults to an empty array.
Declaration
Swift
public var children: [Element]
-
Declaration
Swift
public init( direction: Direction, configure: (inout EqualStack) -> Void = { _ in } )
Parameters
direction
The direction in which this element will stack its children.
configure
A closure allowing the element to be further customized. Defaults to a no-op.
-
Initializer using result builder to declaritively build up a stack.
Declaration
Swift
public init( direction: Direction, spacing: CGFloat = 0, @ElementBuilder<Child> elements: () -> [Child] )
Parameters
direction
Direction of the stack.
children
A block containing all elements to be included in the stack.
-
Declaration
Swift
public var content: ElementContent { get }
-
Declaration
Swift
public func backingViewDescription(with context: ViewDescriptionContext) -> ViewDescription?
-
Declaration
Swift
public mutating func add(child: Element)
-
Declaration
Swift
public enum Direction
-
Declaration
Swift
public struct Child : ElementBuilderChild