MasonryLayout

public struct MasonryLayout : Layout

Masonry Layout

  • Undocumented

    Declaration

    Swift

    public struct CacheData
  • Undocumented

    See more

    Declaration

    Swift

    public enum ViewOrder : Int, CaseIterable
  • Init

    Declaration

    Swift

    public init(numOfColumns: Int = 1, viewOrder: ViewOrder = .topMost, spacing: CGFloat = 8, lineSpacing: CGFloat = 8, alignment: HorizontalAlignment = .center)

    Parameters

    numOfColumns

    Number of columns. The default is 1.

    viewOrder

    View order. The default is .topMost.

    spacing

    Horizontal spacing between views. The default is 8.

    lineSpacing

    Vertical spacing between views. The default is 8.

    alignment

    Horizontal alignment in each column. The default is .center.

  • Returns the size of the composite view, given a proposed size and the view’s subviews.

    Declaration

    Swift

    public func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout CacheData) -> CGSize
  • Assigns positions to each of the layout’s subviews.

    Declaration

    Swift

    public func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout CacheData)
  • Creates and initializes a cache for a layout instance.

    Declaration

    Swift

    public func makeCache(subviews: Subviews) -> CacheData