---
title: "setHoldingPriority(_:forSubviewAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nssplitview/setholdingpriority(_:forsubviewat:)"
---

# setHoldingPriority(_:forSubviewAt:)

Sets the priority for split view subviews to maintain their width or height.

## Declaration

```swift
func setHoldingPriority(_ priority: NSLayoutConstraint.Priority, forSubviewAt subviewIndex: Int)
```

## Parameters

- `priority`: The priority.
- `subviewIndex`: The index of the subview

## Discussion

Discussion Calling this method sets the priority that split view subviews use to maintain their width (for a vertical split view) or height (for a horizontal split view). During a split view resize, subviews with higher priorities maintain their sizes before subviews with lower priorities. The subview with the lowest priority is the first to gain additional thickness if the split view grows or shrinks. The default priority is defaultLow. Use priorities less than dragThatCannotResizeWindow.

## See Also

### Managing Subviews

- [adjustSubviews()](appkit/nssplitview/adjustsubviews().md)
- [isSubviewCollapsed(_:)](appkit/nssplitview/issubviewcollapsed(_:).md)
- [holdingPriorityForSubview(at:)](appkit/nssplitview/holdingpriorityforsubview(at:).md)
