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

# addLayoutGuide(_:)

Adds the provided layout guide to the view.

```
func addLayoutGuide(_ guide: NSLayoutGuide)
```

## Parameters

`guide`

The layout guide to be added.

## Discussion

This method adds the provided layout guide to the end of the view’s [`layoutGuides`](/documentation/AppKit/NSView/layoutGuides) array. It also assigns the view to the guide’s [`owningView`](/documentation/AppKit/NSLayoutGuide/owningView) property. Each guide can have only one owning view.

After the guide has been added to a view, it can participate in Auto Layout constraints with that view’s hierarchy.

---

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)