Instance Property
leadingAnchor
A layout anchor representing the leading edge of the view’s frame.
SDKs
- iOS 9.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Discussion
Use this anchor to create constraints with the view’s leading edge. You can combine this anchor only with a subset of the NSLayoutXAxisAnchor
anchors. You can combine a UIView
with another leadingAnchor
, a trailingAnchor
, or a centerXAnchor
. For more information, see NSLayoutAnchor
.
See Also
Creating Constraints Using Layout Anchors
bottomAnchor
A layout anchor representing the bottom edge of the view’s frame.
centerXAnchor
A layout anchor representing the horizontal center of the view’s frame.
centerYAnchor
A layout anchor representing the vertical center of the view’s frame.
firstBaselineAnchor
A layout anchor representing the baseline for the topmost line of text in the view.
heightAnchor
A layout anchor representing the height of the view’s frame.
lastBaselineAnchor
A layout anchor representing the baseline for the bottommost line of text in the view.
leftAnchor
A layout anchor representing the left edge of the view’s frame.
rightAnchor
A layout anchor representing the right edge of the view’s frame.
topAnchor
A layout anchor representing the top edge of the view’s frame.
trailingAnchor
A layout anchor representing the trailing edge of the view’s frame.
widthAnchor
A layout anchor representing the width of the view’s frame.