StackElement

public protocol StackElement : Element

Conforming types (Row and Column) act as StackLayout powered containers.

This protocol should only be used by Row and Column elements (you should never add conformance to other custom types).

  • Declaration

    Swift

    init()
  • Declaration

    Swift

    var layout: StackLayout { get }
  • Declaration

    Swift

    var children: [(element: Element, traits: StackLayout.Traits, key: AnyHashable?)] { get set }
  • content Extension method

    Declaration

    Swift

    public var content: ElementContent { get }
  • Declaration

    Swift

    public func backingViewDescription(with context: ViewDescriptionContext) -> ViewDescription?
  • init(_:) Extension method

    Declaration

    Swift

    public init(_ configure: (inout Self) -> Void)
  • Adds a given child element to the stack.

    • Tag: StackElement.add

    Declaration

    Swift

    public mutating func add(
        growPriority: CGFloat = 1.0,
        shrinkPriority: CGFloat = 1.0,
        alignmentGuide: ((ElementDimensions) -> CGFloat)? = nil,
        key: AnyHashable? = nil,
        child: Element
    )

    Parameters

    growPriority

    shrinkPriority

    alignmentGuide

    key

    A key used to disambiguate children between subsequent updates of the view hierarchy

    child

    The child element to add to this stack

  • Convenience method for adding a child with a grow and shrink priority of 0.0.

    See StackElement.add(...) for details.

    In Xcode

    StackElement.add()

    Declaration

    Swift

    public mutating func addFixed(
        alignmentGuide: ((ElementDimensions) -> CGFloat)? = nil,
        key: AnyHashable? = nil,
        child: Element
    )

    Parameters

    alignmentGuide

    A closure that can be used to provide a custom alignment guide for this child.

    key

    A key used to disambiguate children between subsequent updates of the view hierarchy

    child

    The child element to add to this stack

  • Convenience method for adding a child with a grow and shrink priority of 1.0.

    See StackElement.add(...) for details.

    In Xcode

    StackElement.add()

    Declaration

    Swift

    public mutating func addFlexible(
        alignmentGuide: ((ElementDimensions) -> CGFloat)? = nil,
        key: AnyHashable? = nil,
        child: Element
    )

    Parameters

    alignmentGuide

    A closure that can be used to provide a custom alignment guide for this child.

    key

    A key used to disambiguate children between subsequent updates of the view hierarchy

    child

    The child element to add to this stack