Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.77 KB

HStack.md

File metadata and controls

53 lines (35 loc) · 1.77 KB

HStack

Horizontal StackView

@available(iOS 9.0, *) public class HStack: UIView

Inheritance

UIView

Initializers

init(withSpacing:padding:alignment:distribution:_:)

Create a HStack

public init(withSpacing spacing: Float = 0, padding: Float = 0, alignment: UIStackView.Alignment = .fill, distribution: UIStackView.Distribution = .fill, _ closure: () -> [UIView])

Parameters

  • withSpacing: The amount of spacing between each child view
  • padding: The amount of space between this view and its parent view
  • alignment: The layout of arranged views perpendicular to the stack view’s axis (source: UIStackView.Alignment)
  • distribution: The layout that defines the size and position of the arranged views along the stack view’s axis (source: UIStackView.Distribution)
  • closure: A trailing closure that accepts an array of views

init(withSpacing:padding:alignment:distribution:_:)

Create a HStack that accepts an array of UIView?

public init(withSpacing spacing: Float = 0, padding: Float = 0, alignment: UIStackView.Alignment = .fill, distribution: UIStackView.Distribution = .fill, _ closure: () -> [UIView?])

Parameters

  • withSpacing: The amount of spacing between each child view
  • padding: The amount of space between this view and its parent view
  • alignment: The layout of arranged views perpendicular to the stack view’s axis (source: UIStackView.Alignment)
  • distribution: The layout that defines the size and position of the arranged views along the stack view’s axis (source: UIStackView.Distribution)
  • closure: A trailing closure that accepts an array of optional views

Methods

update(views:)

public func update(views closure: (inout [UIView]) -> Void) -> Self