StackView

public extension StackView
  • Convenience initializer for simple UIStackView.

    Declaration

    Swift

    convenience init(axis: StackAxis, alignment: Alignment = .fill, distribution: Distribution = .fill, spacing: CGFloat = 0)

    Parameters

    axis

    StackAxis value specifying a horizontal or vertical layout constraint.

    alignment

    Alignment—the layout transverse to the stacking axis. Defaults to .fill.

    distribution

    Value describing the content layout along the stacking axis rules in UIStackView. Defaults to .fill.

    spacing

    Spacing beween content items in UIStackView. Defaults to 0.0

  • Convenience initializer for simple NSStackView.

  • Convenience function to add array of views to StackView. Order in which views added to StackView is the same as in provided array.

    Declaration

    Swift

    @inline(__always)
    func addArrangedSubviews(_ arrangedSubviews: [View])

    Parameters

    arrangedSubviews

    Array of views to be added to StackView.

  • Convenience function to add number of views to StackView. Order in which views added to StackView is the same as in provided array.

    Declaration

    Swift

    @inline(__always)
    func addArrangedSubviews(_ arrangedSubviews: View...)

    Parameters

    arrangedSubviews

    Variadic parameter of View arguments.