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

# splitView(_:canCollapseSubview:)

Allows the delegate to determine whether the user can collapse and expand the specified subview.

```
@MainActor optional func splitView(_ splitView: NSSplitView, canCollapseSubview subview: NSView) -> Bool
```

## Parameters

`splitView`

The split view that sends the message.

`subview`

The subview to collapse.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if `subview` collapses when the user drags a divider beyond the halfway mark between its minimum size and its edge; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The `subview` expands when the user drags the divider beyond the halfway mark between its minimum size and its edge.

To specify the minimum size, define the methods [`splitView(_:constrainMaxCoordinate:ofSubviewAt:)`](/documentation/AppKit/NSSplitViewDelegate/splitView(_:constrainMaxCoordinate:ofSubviewAt:)) and [`splitView(_:constrainMinCoordinate:ofSubviewAt:)`](/documentation/AppKit/NSSplitViewDelegate/splitView(_:constrainMinCoordinate:ofSubviewAt:)). A subview can collapse only if you also define [`splitView(_:constrainMinCoordinate:ofSubviewAt:)`](/documentation/AppKit/NSSplitViewDelegate/splitView(_:constrainMinCoordinate:ofSubviewAt:)).

A collapsed subview isn’t visible, but the split view object retains it with the same size as before the collapse.

If the delegate doesn’t implement this method, the subviews can’t collapse.

---

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)