Contents

sizeThatFits(in:)

Calculates and returns the most appropriate size for the current view.

Declaration

@MainActor @preconcurrency func sizeThatFits(in size: CGSize) -> CGSize

Parameters

  • size:

    The proposed new size for the view.

Return Value

The size that offers the best fit for the root view and its contents.

See Also

Managing the size