Instance Method

contentHuggingPriorityForOrientation:

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

Declaration

- (NSLayoutPriority)contentHuggingPriorityForOrientation:(NSLayoutConstraintOrientation)orientation;

Parameters

orientation

The orientation of the dimension of the view that might be enlarged.

Return Value

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

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.

Subclasses should not override this method. Instead, custom views should set default values for their content on creation, typically to NSLayoutPriorityDefaultLow or NSLayoutPriorityDefaultHigh.

See Also

Measuring in Auto Layout

fittingSize

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

intrinsicContentSize

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

- invalidateIntrinsicContentSize

Invalidates the view’s intrinsic content size.

- contentCompressionResistancePriorityForOrientation:

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

- setContentCompressionResistancePriority:forOrientation:

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

- setContentHuggingPriority:forOrientation:

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