<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: 13.1.0 -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CALayer/constraints",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Animation",
      "QuartzCore"
    ],
    "preciseIdentifier" : "c:objc(cs)CALayer(py)constraints"
  },
  "title" : "constraints"
}
-->

# constraints

The constraints used to position current layer’s sublayers.

```
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`](/documentation/QuartzCore/CAConstraintLayoutManager) object to the [`layoutManager`](/documentation/QuartzCore/CALayer/layoutManager) property of the layer.

iOS apps do not support layer-based constraints.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)