Instance Method

contentHuggingPriority(for:)

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

Declaration

func contentHuggingPriority(for axis: UILayoutConstraintAxis) -> UILayoutPriority

Parameters

axis

The axis of the view that might be enlarged.

Return Value

The priority with which the view should resist being enlarged from its intrinsic size on the specified axis.

Discussion

The constraint-based layout system uses these priorities when determining the best layout for views that are encountering constraints that would require them to be larger than their intrinsic size.

See Also

Measuring in Auto Layout

func systemLayoutSizeFitting(CGSize)

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

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 setContentHuggingPriority(UILayoutPriority, for: UILayoutConstraintAxis)

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