Instance Method

splitView(_:shouldAdjustSizeOfSubview:)

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

Declaration

optional func splitView(_ splitView: NSSplitView, shouldAdjustSizeOfSubview view: NSView) -> Bool

Parameters

splitView

The split view that sent the message.

subview

The subview to resize.

Return Value

true if adjustSubviews can change the size of the subview, otherwise false. By returning false, you lock the size of the split view subview while the split view is resized.

Discussion

Regardless of the value returned by this method, adjustSubviews() may change the origin of the subview. Otherwise non-resizable subviews may also be resized in order to prevent an invalid subview layout.

If a split view has no delegate, or if its delegate does not respond to this message, the split view behaves as if this method returns true.

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, 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.