---
title: "splitView(_:shouldCollapseSubview:forDoubleClickOnDividerAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nssplitviewdelegate/splitview(_:shouldcollapsesubview:fordoubleclickondividerat:)"
---

# splitView(_:shouldCollapseSubview:forDoubleClickOnDividerAt:)

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

## Declaration

```swift
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

Return Value true if the subview should collapse; otherwise, false.

## Discussion

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 true when it receives splitView(_:canCollapseSubview:) for the subview in question. When the delegate indicates that both subviews should collapse, the behavior of NSSplitView is undefined.

## See Also

### Managing Subviews

- [splitViewWillResizeSubviews(_:)](appkit/nssplitviewdelegate/splitviewwillresizesubviews(_:).md)
- [splitViewDidResizeSubviews(_:)](appkit/nssplitviewdelegate/splitviewdidresizesubviews(_:).md)
- [splitView(_:canCollapseSubview:)](appkit/nssplitviewdelegate/splitview(_:cancollapsesubview:).md)
