Instance Method

systemLayoutSizeFitting(_:)

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

Declaration

func systemLayoutSizeFitting(_ targetSize: CGSize) -> CGSize

Parameters

targetSize

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

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.

See Also

Measuring in Auto Layout

var intrinsicContentSize: CGSize

The natural size for the receiving view, considering only properties of the view itself.

func invalidateIntrinsicContentSize()

Invalidates the view’s intrinsic content size.

func contentCompressionResistancePriority(for: UILayoutConstraintAxis)

Returns the priority with which a view resists being made smaller than its intrinsic size.

func setContentCompressionResistancePriority(UILayoutPriority, for: UILayoutConstraintAxis)

Sets the priority with which a view resists being made smaller than its intrinsic size.

func contentHuggingPriority(for: UILayoutConstraintAxis)

Returns the priority with which a view resists being made larger than its intrinsic size.

func setContentHuggingPriority(UILayoutPriority, for: UILayoutConstraintAxis)

Sets the priority with which a view resists being made larger than its intrinsic size.