AdaptiveLayoutElement

public protocol AdaptiveLayoutElement : AnyObject

Element that may adapt to proposed size

  • Asks the layout element to calculate and return the size that best fits the specified size

    Declaration

    Swift

    func sizeThatFits(_ size: CGSize) -> CGSize

    Parameters

    size

    The size for which the view should calculate its best-fitting size

    Return Value

    A new size that fits the receiver’s content