Inherits From: NSView : NSResponder : NSObject
Conforms To: NSCoding (NSResponder) NSObject (NSObject)
Declared In: AppKit/NSSplitView.h
An NSSplitView object lets several views share a region within a window. The NSSplitView resizes its subviews so that each subview is the same width as the NSSplitView, and the total of the subviews' heights is equal to the height of the NSSplitView. The NSSplitView positions its subviews so that the first subview is at the top of the NSSplitView, and each successive subview is positioned below the previous one. The user can set the height of two subviews by moving a horizontal bar called the divider, which makes one subview smaller and the other larger.
To add a view to an NSSplitView, you use the NSView method addSubview:. When the NSSplitView is displayed, it checks to see if its subviews are properly tiled. If not, it invokes the delegate method splitView:resizeSubviewsWithOldSize:, allowing the delegate to specify the heights of specific subviews. If the delegate doesn't implement this method, the NSSplitView sends adjustSubviews to itself to yield the default tiling behavior.
When a mouse-down occurs in an NSSplitView's divider, the NSSplitView determines the limits of the divider's travel and tracks the mouse to allow the user to drag the divider within these limits. With the following mouse-up, the NSSplitView resizes the two affected subviews, informs the delegate that the subviews were resized, and displays the affected views and divider. The NSSplitView's delegate can constrain the travel of specific dividers by implementing the method splitView:constrainMinCoordinate:maxCoordinate:ofSubviewAt:.
Managing Component Views