---
title: constraints
framework: quartzcore
role: symbol
role_heading: Instance Property
path: quartzcore/calayer/constraints
---

# constraints

The constraints used to position current layer’s sublayers.

## Declaration

```swift
var constraints: [CAConstraint]? { get set }
```

## Discussion

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

- [addConstraint(_:)](quartzcore/calayer/addconstraint(_:).md)
