---
title: "anchorAttribute(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/anchorattribute(for:)"
---

# anchorAttribute(for:)

Returns the part of the window that stays stationary during constraint-based layout.

## Declaration

```swift
func anchorAttribute(for orientation: NSLayoutConstraint.Orientation) -> NSLayoutConstraint.Attribute
```

## Parameters

- `orientation`: The attribute for orientation. doc://com.apple.appkit/documentation/AppKit/NSLayoutConstraint/Orientationspecifies the possible values.

## Return Value

Return Value Returns the layout attribute.

## See Also

### Constraint-Based Layouts

- [setAnchorAttribute(_:for:)](appkit/nswindow/setanchorattribute(_:for:).md)
