<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSLayoutConstraint/activate(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLayoutConstraint(cm)activateConstraints:"
  },
  "title" : "activate(_:)"
}
-->

# activate(_:)

Activates each constraint in the specified array.

```
class func activate(_ constraints: [NSLayoutConstraint])
```

## Parameters

`constraints`

An array of constraints to activate.

## Discussion

This convenience method provides an easy way to activate a set of constraints with one call. The effect of this method is the same as setting the [`isActive`](/documentation/AppKit/NSLayoutConstraint/isActive) property of each constraint to <doc://com.apple.documentation/documentation/Swift/true>. Typically, using this method is more efficient than activating each constraint individually.

---

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)