<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSLayoutConstraint/isActive",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLayoutConstraint(py)active"
  },
  "title" : "isActive"
}
-->

# isActive

The active state of the constraint.

```
var isActive: Bool { get set }
```

## Discussion

You can activate or deactivate a constraint by changing this property. Note that only active constraints affect the calculated layout. If you try to activate a constraint whose items have no common ancestor, an exception is thrown. For newly created constraints, the [`isActive`](/documentation/UIKit/NSLayoutConstraint/isActive) property is <doc://com.apple.documentation/documentation/Swift/false> by default.

Activating or deactivating the constraint calls [`addConstraint(_:)`](/documentation/UIKit/UIView/addConstraint(_:)) and [`removeConstraint(_:)`](/documentation/UIKit/UIView/removeConstraint(_:)) on the view that is the closest common ancestor of the items managed by this constraint. Use this property instead of calling [`addConstraint(_:)`](/documentation/UIKit/UIView/addConstraint(_:)) or [`removeConstraint(_:)`](/documentation/UIKit/UIView/removeConstraint(_:)) directly.

---

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)