Instance Property

constraints

The constraints used to position current layer’s sublayers.

Declaration

var constraints: [CAConstraint]? { get set }

Discussion

macOS apps can use this property to access their layer-based constraints. Before constraints can be applied, you must also assign a CAConstraintLayoutManager object to the layoutManager property of the layer.

iOS apps do not support layer-based constraints.

See Also

Managing Layer Constraints

func addConstraint(CAConstraint)

Adds the specified constraint to the layer.

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