<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSViewController/updateViewConstraints()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSViewController(im)updateViewConstraints"
  },
  "title" : "updateViewConstraints()"
}
-->

# updateViewConstraints()

Called during Auto Layout constraint updating to enable the view controller to mediate the process.

```
func updateViewConstraints()
```

## Discussion

This method gets called, for example, when the user interacts with a view in a way that causes the layout to change. When called, the default implementation of this method in turn calls the [`updateConstraints()`](/documentation/AppKit/NSView/updateConstraints()) method on the view controller’s view.

You can override this method to update custom view constraints, as an alternative to subclassing the view controller’s view and overriding its [`updateConstraints()`](/documentation/AppKit/NSView/updateConstraints()) method.

If you override this method, you must call this method on `super` at some point in your implementation or call the [`updateConstraints()`](/documentation/AppKit/NSView/updateConstraints()) method on the view controller’s view.

This method is called only for apps that link against macOS 10.10 or later.

This method supports automatic observation tracking. For more information, see [Updating views automatically with observation tracking in AppKit](/documentation/AppKit/updating-views-automatically-with-observation-tracking-in-appkit).

---

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)