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 } -
contentExtension methodDeclaration
Swift
public var content: ElementContent { get } -
backingViewDescription(with:Extension method) Declaration
Swift
public func backingViewDescription(with context: ViewDescriptionContext) -> ViewDescription? -
init(_:Extension method) Declaration
Swift
public init(_ configure: (inout Self) -> Void) -
add(growPriority:Extension methodshrinkPriority: alignmentGuide: key: child: ) 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
growPriorityshrinkPriorityalignmentGuidekeyA key used to disambiguate children between subsequent updates of the view hierarchy
childThe child element to add to this stack
-
addFixed(alignmentGuide:Extension methodkey: child: ) Convenience method for adding a child with a grow and shrink priority of 0.0.
See
StackElement.add(...)for details.In Xcode
Declaration
Swift
public mutating func addFixed( alignmentGuide: ((ElementDimensions) -> CGFloat)? = nil, key: AnyHashable? = nil, child: Element )Parameters
alignmentGuideA closure that can be used to provide a custom alignment guide for this child.
keyA key used to disambiguate children between subsequent updates of the view hierarchy
childThe child element to add to this stack
-
addFlexible(alignmentGuide:Extension methodkey: child: ) Convenience method for adding a child with a grow and shrink priority of 1.0.
See
StackElement.add(...)for details.In Xcode
Declaration
Swift
public mutating func addFlexible( alignmentGuide: ((ElementDimensions) -> CGFloat)? = nil, key: AnyHashable? = nil, child: Element )Parameters
alignmentGuideA closure that can be used to provide a custom alignment guide for this child.
keyA key used to disambiguate children between subsequent updates of the view hierarchy
childThe child element to add to this stack
View on GitHub
StackElement Protocol Reference