Class

NSLayoutXAxisAnchor

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

Overview

Although this class does not provide any additional methods, it does add type information to the methods inherited from NSLayoutAnchor. Specifically, the generic methods declared by NSLayoutAnchor must now take a matching NSLayoutXAxisAnchor object.

// This constraint is valid
cancelButton.leadingAnchor.constraintEqualToAnchor(saveButton.trailingAnchor, constant: 8.0).active = true
 
// This constraint generates an incompatible pointer type warning
cancelButton.leadingAnchor.constraintEqualToAnchor(saveButton.topAnchor, constant: 8.0).active = true

For more information on using layout anchors, see NSLayoutAnchor.

Relationships

Inherits From

See Also

View Layout

class NSLayoutConstraint

The relationship between two user interface objects that must be satisfied by the constraint-based layout system.

protocol UILayoutSupport

A set of methods that provide layout support and access to layout anchors.

class UILayoutGuide

A rectangular area that can interact with Auto Layout.

class NSLayoutAnchor

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

class NSLayoutDimension

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

class NSLayoutYAxisAnchor

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software