Search code examples
ioscocoacocoa-touchnssplitview

NSSplitView Proposed split divider not going to right place?


I have an NSSplitViewDelegate, and I'm constraining the SplitPosition. However, in an edge case, if I move the cursor dragging the divider off the edge of the screen, the divider itself starts at (0, 0). However, this happens even if the proposedPosition is 200, all I have to do is quickly drag the mouse off the screen. Is there any reason that the divider is being set to 0?

PseudoCode

constrainSplitPosition
ProposedPosition = 220 (after dragging mouse off screen quickly, so last marker is at 220)

splitView
(returns a drawnRect for the divider at origin (0,0), corresponds to mouse off screen).

Any ideas, thanks!


Solution

  • You need to add a constrainMinPosition function as outlined in the apple documentation.