Instance Method

splitView(_:effectiveRect:forDrawnRect:ofDividerAt:)

Allows the delegate to modify the rectangle in which mouse clicks initiate divider dragging.

Declaration

optional func splitView(_ splitView: NSSplitView, effectiveRect proposedEffectiveRect: NSRect, forDrawnRect drawnRect: NSRect, ofDividerAt dividerIndex: Int) -> NSRect

Parameters

splitView

The split view that sent the message.

proposedEffectiveRect

The proposed rectangle in which mouse clicks should initiate divider dragging. The rectangle is expressed in the coordinate system defined by splitView.

drawnRect

The frame of the divider, expressed in the coordinate system defined by splitView.

dividerIndex

The index of the divider.

Return Value

The rectangle in which mouse clicks should initiate divider dragging. The rectangle should be expressed in the coordinate system defined by splitView.

Discussion

A split view with thick dividers proposes the drawn frame as the effective frame. A split view with thin dividers proposes an effective frame that's a little larger than the drawn frame, to make it easier for the user to actually grab the divider.

If a split view has no delegate, or if its delegate does not respond to this message, the split view behaves as if it has a delegate that returns proposedEffectiveRect when sent this message.

See Also

Configuring and Drawing View Dividers

func splitView(NSSplitView, shouldHideDividerAt: Int) -> Bool

Allows the delegate to determine whether a divider can be dragged or adjusted off the edge of the split view.

func splitView(NSSplitView, additionalEffectiveRectOfDividerAt: Int) -> NSRect

Allows the delegate to return an additional rectangle in which mouse clicks will initiate divider dragging.