Instance Method

splitView(_:constrainMaxCoordinate:ofSubviewAt:)

Allows the delegate for sender to constrain the maximum coordinate limit of a divider when the user drags it.

Declaration

optional func splitView(_ splitView: NSSplitView, constrainMaxCoordinate proposedMaximumPosition: CGFloat, ofSubviewAt dividerIndex: Int) -> CGFloat

Parameters

splitView

The split view that sent the message.

proposedMax

The proposed maximum coordinate limit of the subview, in the split view’s flipped coordinate system.

dividerIndex

Specifies the divider the user is moving, with the first divider being 0 and increasing from top to bottom (or left to right).

Return Value

The maximum coordinate limit of the divider.

Discussion

This method is invoked before the split view begins tracking the mouse to position a divider. You may further constrain the limits that have been already set, but you cannot extend the divider limits.

If the split bars are horizontal (views are one on top of the other), proposedMax is the bottom limit. If the split bars are vertical (views are side by side), proposedMax is the right limit. The initial value of proposedMax is the bottom (or right side) of the subview after the divider.

See Also

Constraining Split Position

func splitView(NSSplitView, constrainMinCoordinate: CGFloat, ofSubviewAt: Int)

Allows the delegate for sender to constrain the minimum coordinate limit of a divider when the user drags it.

func splitView(NSSplitView, constrainSplitPosition: CGFloat, ofSubviewAt: Int)

Allows the delegate for sender to constrain the divider to certain positions.