<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSplitView/setPosition(_:ofDividerAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSplitView(im)setPosition:ofDividerAtIndex:"
  },
  "title" : "setPosition(_:ofDividerAt:)"
}
-->

# setPosition(_:ofDividerAt:)

Updates the location of a divider you specify by index.

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

## Parameters

`position`

The position of the divider.

`dividerIndex`

The index of the divider.

## 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`](/documentation/AppKit/NSSplitView) doesn’t invoke this method.

---

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)