Sets the priority with which a view resists being made smaller than its intrinsic size.
SDK
- macOS 10.7+
Framework
- App
Kit
Declaration
func setContentCompressionResistancePriority(_ priority: NSLayout Constraint.Priority, for orientation: NSLayout Constraint.Orientation)
Parameters
priority
The new priority.
orientation
The orientation for which the compression resistance priority should be set.
Discussion
Custom views should set default values for both orientations on creation, based on their content, typically to NSLayoutPriorityDefaultLow or NSLayoutPriorityDefaultHigh. When creating user interfaces, the layout designer can modify these priorities for specific views when the overall layout design requires different tradeoffs than the natural priorities of the views being used in the interface.
Subclasses should not override this method.