The part of the object’s visual representation that should be used to get the value for the constraint.
SDKs
- iOS 6.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
Frameworks
- UIKit
- App
Kit
Declaration
enum Attribute : Int
The part of the object’s visual representation that should be used to get the value for the constraint.
SDKs
Frameworks
enum Attribute : Int
case left
The left side of the object’s alignment rectangle.
case right
The right side of the object’s alignment rectangle.
case top
The top of the object’s alignment rectangle.
case bottom
The bottom of the object’s alignment rectangle.
case leading
The leading edge of the object’s alignment rectangle.
case trailing
The trailing edge of the object’s alignment rectangle.
case width
The width of the object’s alignment rectangle.
case height
The height of the object’s alignment rectangle.
case center X
The center along the x-axis of the object’s alignment rectangle.
case center Y
The center along the y-axis of the object’s alignment rectangle.
case last Baseline
The object’s baseline. For objects with more than one line of text, this is the baseline for the bottommost line of text.
case first Baseline
The object’s baseline. For objects with more than one line of text, this is the baseline for the topmost line of text.
case left Margin
The object’s left margin. For UIView
objects, the margins are defined by their layout
property.
case right Margin
The object’s right margin. For UIView
objects, the margins are defined by their layout
property.
case top Margin
The object’s top margin. For UIView
objects, the margins are defined by their layout
property.
case bottom Margin
The object’s bottom margin. For UIView
objects, the margins are defined by their layout
property.
case leading Margin
The object’s leading margin. For UIView
objects, the margins are defined by their layout
property.
case trailing Margin
The object’s trailing margin. For UIView
objects, the margins are defined by their layout
property.
case center XWithin Margins
The center along the x-axis between the object’s left and right margin. For UIView
objects, the margins are defined by their layout
property.
case center YWithin Margins
The center along the y-axis between the object’s top and bottom margin. For UIView
objects, the margins are defined by their layout
property.
case not An Attribute
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
. If a constraint only has one item, set the second item to nil
, and set the second attribute to NSLayout
.