Returns the view’s alignment rectangle for a given frame.
- iOS 6.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The frame whose corresponding alignment rectangle is desired.
The alignment rectangle for the specified frame.
The constraint-based layout system uses alignment rectangles to align views, rather than their frame. This allows custom views to be aligned based on the location of their content while still having a frame that encompasses any ornamentation they need to draw around their content, such as shadows or reflections.
The default implementation returns the view’s frame modified by the view’s
alignment. Most custom views can use
alignment to specify the location of their content within their frame. Custom views that require arbitrary transformations can override
frame(for to describe the location of their content. These two methods must always be inverses of each other.