Contents

splitView(_:constrainMaxCoordinate:ofSubviewAt:)

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

Declaration

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

Parameters

  • splitView:

    The split view that sends the message.

  • proposedMaximumPosition:

    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

The delegate receives this message before the split view begins tracking the mouse to position a divider. You can further constrain the limits, but you can’t 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

Adjusting Subviews Manually