Structure

NSLayoutConstraint.Priority

Layout priority used to indicate the relative importance of constraints, allowing Auto Layout to make appropriate tradeoffs when satisfying the constraints of the system as a whole.

Topics

Constants

static let defaultHigh: NSLayoutConstraint.Priority

Priority level with which a button resists compressing its content.

static let dragThatCanResizeWindow: NSLayoutConstraint.Priority

Appropriate priority level for a drag that may end up resizing the window.

static let windowSizeStayPut: NSLayoutConstraint.Priority

Priority level for the window’s current size.

static let dragThatCannotResizeWindow: NSLayoutConstraint.Priority

Priority level at which a split view divider, say, is dragged.

static let defaultLow: NSLayoutConstraint.Priority

Priority level at which a button hugs its contents horizontally.

static let fittingSizeCompression: NSLayoutConstraint.Priority

When you send a fittingSize message to a view, the smallest size that is large enough for the view's contents is computed.

Relationships

See Also

Getting the Layout Priority

var priority: UILayoutPriority

The priority of the constraint.

struct UILayoutPriority

The layout priority is used to indicate to the constraint-based layout system which constraints are more important, allowing the system to make appropriate tradeoffs when satisfying the constraints of the system as a whole.

static let required: UILayoutPriority

A required constraint. Do not specify a layout constraint that exceeds this number.

static let defaultHigh: UILayoutPriority

This is the priority level with which a button resists compressing its content.

static let defaultLow: UILayoutPriority

This is the priority level at which a button hugs its contents horizontally.

static let fittingSizeLevel: UILayoutPriority

When you send a systemLayoutSizeFitting(_:) message to a view, the size fitting most closely to the target size is computed. This is the priority level with which the view wants to conform to the target size in that computation. It's quite low. It is generally not appropriate to make a constraint at exactly this priority. You want to be higher or lower.