SplitView demonstrates the API from the perspective of a view. It implements a split view with one extra feature: when a divider is dragged, it pushes other dividers out of the way if necessary, and they snap back. The class is 245 lines long compared with NSSplitView's 2502. This is of course not a fair comparison because NSSplitView does more, but it's clear that it's a lot simpler, particularly in the dragging code. This example illustrates fancy use of priority, overriding updateConstraints, dragging, and constraints that cross the view hierarchy.


This sample requires OS X 10.7 or higher.