Instance Method

systemLayoutSizeFitting(_:withHorizontalFittingPriority:verticalFittingPriority:)

Returns the size of the view that satisfies the constraints it holds.

Declaration

func systemLayoutSizeFitting(_ targetSize: CGSize, withHorizontalFittingPriority horizontalFittingPriority: UILayoutPriority, verticalFittingPriority: UILayoutPriority) -> CGSize

Parameters

targetSize

Indicates whether you want the smallest or largest possible size that meets the constraints. See Fitting Size for accepted values.

horizontalFittingPriority

The horizontal constraint priority.

verticalFittingPriority

The vertical constraint priority.

Return Value

The size of the view that satisfies the constraints it holds.

Discussion

Determines the best size of the view considering all constraints it holds and those of its subviews.