Instance Method

splitView(_:resizeSubviewsWithOldSize:)

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

Declaration

optional func splitView(_ splitView: NSSplitView, resizeSubviewsWithOldSize oldSize: NSSize)

Parameters

splitView

The split view that sent the message.

oldSize

The size of the split view before the user resized it.

Discussion

If the delegate implements this method, splitView(_:resizeSubviewsWithOldSize:) is invoked after the split view is resized.

The subviews should be resized such that the sum of the sizes of the subviews plus the sum of the thickness of the dividers equals the size of the NSSplitView’s new frame. You can get the thickness of a divider through the dividerThickness method.

Note that if you implement this delegate method to resize subviews on your own, the NSSplitView does not perform any error checking for you. However, you can invoke adjustSubviews() to perform the default sizing behavior.

See Also

Managing Subviews

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, canCollapseSubview: NSView)

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

func splitView(NSSplitView, shouldCollapseSubview: NSView, forDoubleClickOnDividerAt: Int)

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

func splitView(NSSplitView, shouldAdjustSizeOfSubview: NSView)

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