Enumeration

NSLayoutAttribute

The part of the object’s visual representation that should be used to get the value for the constraint.

Topics

Constants

NSLayoutAttributeLeft

The left side of the object’s alignment rectangle.

NSLayoutAttributeRight

The right side of the object’s alignment rectangle.

NSLayoutAttributeTop

The top of the object’s alignment rectangle.

NSLayoutAttributeBottom

The bottom of the object’s alignment rectangle.

NSLayoutAttributeLeading

The leading edge of the object’s alignment rectangle.

NSLayoutAttributeTrailing

The trailing edge of the object’s alignment rectangle.

NSLayoutAttributeWidth

The width of the object’s alignment rectangle.

NSLayoutAttributeHeight

The height of the object’s alignment rectangle.

NSLayoutAttributeCenterX

The center along the x-axis of the object’s alignment rectangle.

NSLayoutAttributeCenterY

The center along the y-axis of the object’s alignment rectangle.

NSLayoutAttributeBaseline

The object’s baseline.

NSLayoutAttributeLastBaseline

The object’s baseline. For objects with more than one line of text, this is the baseline for the bottommost line of text.

NSLayoutAttributeFirstBaseline

The object’s baseline. For objects with more than one line of text, this is the baseline for the topmost line of text.

NSLayoutAttributeLeftMargin

The object’s left margin. For UIView objects, the margins are defined by their layoutMargins property.

NSLayoutAttributeRightMargin

The object’s right margin. For UIView objects, the margins are defined by their layoutMargins property.

NSLayoutAttributeTopMargin

The object’s top margin. For UIView objects, the margins are defined by their layoutMargins property.

NSLayoutAttributeBottomMargin

The object’s bottom margin. For UIView objects, the margins are defined by their layoutMargins property.

NSLayoutAttributeLeadingMargin

The object’s leading margin. For UIView objects, the margins are defined by their layoutMargins property.

NSLayoutAttributeTrailingMargin

The object’s trailing margin. For UIView objects, the margins are defined by their layoutMargins property.

NSLayoutAttributeCenterXWithinMargins

The center along the x-axis between the object’s left and right margin. For UIView objects, the margins are defined by their layoutMargins property.

NSLayoutAttributeCenterYWithinMargins

The center along the y-axis between the object’s top and bottom margin. For UIView objects, the margins are defined by their layoutMargins property.

NSLayoutAttributeNotAnAttribute

A placeholder value that is used to indicate that the constraint’s second item and second attribute are not used in any calculations. Use this value when creating a constraint that assigns a constant to an attribute. For example, item1.height >= 40. If a constraint only has one item, set the second item to nil, and set the second attribute to NSLayoutAttributeNotAnAttribute.