<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSLayoutConstraint/shouldBeArchived",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLayoutConstraint(py)shouldBeArchived"
  },
  "title" : "shouldBeArchived"
}
-->

# shouldBeArchived

A Boolean value that determines whether the constraint should be archived by its owning view.

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

## Discussion

When a view is archived, it archives some but not all constraints in its [`constraints`](/documentation/AppKit/NSView/constraints) array. The value of [`shouldBeArchived`](/documentation/AppKit/NSLayoutConstraint/shouldBeArchived) informs the view if a particular constraint should be archived by the view.

If a constraint is created at runtime in response to the state of the object, it isn’t appropriate to archive the constraint. Instead you archive the state that gives rise to the constraint. The default value for this property is <doc://com.apple.documentation/documentation/Swift/false>.

---

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)