---
title: "huggingPriority(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsstackview/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.

## Declaration

```swift
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 doc://com.apple.appkit/documentation/AppKit/NSUserInterfaceLayoutOrientation enumeration.

## Return Value

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

## See Also

### Related Documentation

- [setHuggingPriority(_:for:)](appkit/nsstackview/sethuggingpriority(_:for:).md)

### Inspecting a Stack View

- [views](appkit/nsstackview/views.md)
- [views(in:)](appkit/nsstackview/views(in:).md)
- [detachedViews](appkit/nsstackview/detachedviews.md)
- [clippingResistancePriority(for:)](appkit/nsstackview/clippingresistancepriority(for:).md)
