Class

NSLayoutYAxisAnchor

A factory class for creating vertical layout constraint objects using a fluent API.

Declaration

@interface NSLayoutYAxisAnchor : NSLayoutAnchor

Overview

NSLayoutYAxisAnchor adds type information to the methods inherited from NSLayoutAnchor. Specifically, the generic methods declared by NSLayoutAnchor must now take a matching NSLayoutYAxisAnchor object.

// This constraint is valid
[self.cancelButton.leadingAnchor constraintEqualToAnchor:self.saveButton.trailingAnchor  constant: 8.0].active = true;
 
// This constraint generates an incompatible pointer type warning
[self.cancelButton.topAnchor constraintEqualToAnchor:self.saveButton.trailingAnchor constant: 8.0].active = true;

For more information on using layout anchors, see NSLayoutAnchor.

Topics

Building System Spacing Constraints

- constraintEqualToSystemSpacingBelowAnchor:multiplier:

Returns a constraint that defines the specific distance at which the current anchor is positioned below the specified anchor.

- constraintGreaterThanOrEqualToSystemSpacingBelowAnchor:multiplier:

Returns a constraint that defines the minimum distance by which the current anchor is positioned below the specified anchor.

- constraintLessThanOrEqualToSystemSpacingBelowAnchor:multiplier:

Returns a constraint that defines the maximum distance by which the current anchor is positioned below the specified anchor.

Creating Self-Sizing Table View Cells

Create table view cells that support Dynamic Type and use system spacing constraints to adjust the spacing surrounding text labels.

Creating a Layout Dimension

- anchorWithOffsetToAnchor:

Creates a layout dimension object from two anchors.

Relationships

Inherits From

See Also

Anchors

NSLayoutAnchor

A factory class for creating layout constraint objects using a fluent API.

NSLayoutXAxisAnchor

A factory class for creating horizontal layout constraint objects using a fluent API.