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

# visualizeConstraints(_:)

Displays a visual representation of the supplied constraints in the window.

```
func visualizeConstraints(_ constraints: [NSLayoutConstraint]?)
```

## Parameters

`constraints`

The constraints to visualize. All constraints must be held by views in the window.

## Discussion

The constraints to visualize are typically discovered by identifying a view whose layout is unexpected and then calling [`constraintsAffectingLayout(for:)`](/documentation/AppKit/NSView/constraintsAffectingLayout(for:)) on that view.

This method should only be used for debugging constraint-based layout. No application should ship with calls to this method as part of its operation.

---

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)