---
title: "setPosition(_:ofDividerAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nssplitview/setposition(_:ofdividerat:)"
---

# setPosition(_:ofDividerAt:)

Updates the location of a divider you specify by index.

## Declaration

```swift
func setPosition(_ position: CGFloat, ofDividerAt dividerIndex: Int)
```

## Parameters

- `position`: The position of the divider.
- `dividerIndex`: The index of the divider.

## Discussion

Discussion One of the views adjacent to the divider may collapse because the method’s default implementation assumes a person is dragging the divider to the new location. The Auto Layout system collapses the view if it can’t satisfy the view’s constraints — typically imposed by its delegate — with the divider’s new location. NSSplitView doesn’t invoke this method.

## See Also

### Constraining Split Position

- [minPossiblePositionOfDivider(at:)](appkit/nssplitview/minpossiblepositionofdivider(at:).md)
- [maxPossiblePositionOfDivider(at:)](appkit/nssplitview/maxpossiblepositionofdivider(at:).md)
