LegacyLayout

public protocol LegacyLayout
  • Per-item metadata that is used during the measuring and layout pass.

    Declaration

    Swift

    associatedtype Traits = ()
  • Computes the size that this layout requires in a layout, given an array of children and accompanying layout traits.

    Declaration

    Swift

    func measure(in constraint: SizeConstraint, items: [(traits: Self.Traits, content: Measurable)]) -> CGSize

    Parameters

    constraint

    The size constraint in which measuring should occur.

    items

    An array of ‘items’, pairs consisting of a traits object and a Measurable value.

    Return Value

    The measured size for the given array of items.

  • Generates layout attributes for the given items.

    Declaration

    Swift

    func layout(size: CGSize, items: [(traits: Self.Traits, content: Measurable)]) -> [LayoutAttributes]

    Parameters

    size

    The size that layout attributes should be generated within.

    items

    An array of ‘items’, pairs consisting of a traits object and a Measurable value.

    Return Value

    Layout attributes for the given array of items.

  • Returns a default traits object.

    Declaration

    Swift

    static var defaultTraits: Self.Traits { get }