Suppose you want each of the two sections on a vertical splitter to be at least 70.0, so what would you do:
- (CGFloat) splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex { return 70.0; } - (CGFloat) splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex { return splitView.frame.size.height - 70.0; }
The reason for the subtraction is the dynamic accounting of any change in size (for example, autorun) of a common instance of NSplitView. If you work with horizontal, you will need to calculate instead of .width instead of .height . If you have more than two subzones, you can expand this idea by looking at dividerIndex and applying the values as you like.
source share