constraint

A constraint is a relationship between two attributes in the user interface. For example, to center a view in a superview uses two constraints, the horizontal center of the view is equal to the horizontal center of the superview, and the vertical center of the view is equal to the vertical center of the superview.

A constraint has 6 parts:

First item: The first attribute, such as the top of a view.

Second item: The second attribute, such as the bottom of a view. This item can be nil.

Constant: An integer value for the constraint, such as a distance or size.

Relationship: The relationship between the two attributes: equal to, less than or equal to, or greater than or equal to.

Priority: The relative priority of satisfying the constraint.

Multiplier: A multiplier applied to the constant