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

# huggingPriority(for:)

Returns the Auto Layout priority for the stack view to minimize its size to fit its contained views as closely as possible, for a specified user interface axis.

```
func huggingPriority(for orientation: NSLayoutConstraint.Orientation) -> NSLayoutConstraint.Priority
```

## Parameters

`orientation`

The user interface axis (horizontal or vertical) whose hugging priority you want to get from the stack view. Valid values are those in the [`NSUserInterfaceLayoutOrientation`](/documentation/AppKit/NSUserInterfaceLayoutOrientation) enumeration.

## Return Value

The Auto Layout priority for the stack view to minimize its size.

## See Also

[`setHuggingPriority(_:for:)`](/documentation/AppKit/NSStackView/setHuggingPriority(_:for:))

Sets the Auto Layout priority for the stack view to minimize its size, for a specified user interface axis.



---

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)