Instance Method

splitView(_:canCollapseSubview:)

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

Declaration

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

Parameters

splitView

The split view that sent the message.

subview

The subview to collapse.

Return Value

true if subview should collapse when the user drags a divider beyond the halfway mark between its minimum size and its edge, otherwise false.

Discussion

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

To specify the minimum size, define the methods splitView(_:constrainMaxCoordinate:ofSubviewAt:) and splitView(_:constrainMinCoordinate:ofSubviewAt:). A subview can collapse only if you also define splitView(_:constrainMinCoordinate:ofSubviewAt:).

A collapsed subview is hidden but retained by the split view object, with the same size it had before it was collapsed.

If the delegate does not implement this method the subviews can’t be collapsed.

See Also

Managing Subviews

func splitView(NSSplitView, resizeSubviewsWithOldSize: NSSize)

Allows the delegate to specify custom sizing behavior for the subviews of the NSSplitView sender.

func splitViewWillResizeSubviews(Notification)

Invoked by the default notification center to notify the delegate that the splitview will resize its subviews.

func splitViewDidResizeSubviews(Notification)

Invoked by the default notification center to notify the delegate that the splitview did resize its subviews.

func splitView(NSSplitView, shouldCollapseSubview: NSView, forDoubleClickOnDividerAt: Int) -> Bool

Invoked to allow a delegate to determine if a subview should collapse in response to a double click.

Deprecated
func splitView(NSSplitView, shouldAdjustSizeOfSubview: NSView) -> Bool

Allows the delegate to specify whether the subview should be resized.