<!--
{
  "availability" : [
    "macOS: 10.5.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSplitViewDelegate/splitView(_:shouldCollapseSubview:forDoubleClickOnDividerAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSSplitViewDelegate(im)splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:"
  },
  "title" : "splitView(_:shouldCollapseSubview:forDoubleClickOnDividerAt:)"
}
-->

# splitView(_:shouldCollapseSubview:forDoubleClickOnDividerAt:)

Allows a delegate to determine if a subview collapses in response to a double click.

```
optional func splitView(_ splitView: NSSplitView, shouldCollapseSubview subview: NSView, forDoubleClickOnDividerAt dividerIndex: Int) -> Bool
```

## Parameters

`splitView`

The split view that sends the message.

`subview`

The subview to collapse.

`dividerIndex`

The index of the divider.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the subview should collapse; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

If the delegate implements this method, it receives this message once for the subview before a divider when the user double-clicks that divider, and again for the subview after the divider, but only if the delegate returns <doc://com.apple.documentation/documentation/Swift/true> when it receives [`splitView(_:canCollapseSubview:)`](/documentation/AppKit/NSSplitViewDelegate/splitView(_:canCollapseSubview:)) for the subview in question. When the delegate indicates that both subviews should collapse, the behavior of [`NSSplitView`](/documentation/AppKit/NSSplitView) is undefined.

---

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)