BWToolkit 1.1: Codeless Split Views

Posted: February 24th, 2009 | Author: | Filed under: Releases | Comments Off on BWToolkit 1.1: Codeless Split Views

I’m pleased to announce that BWToolkit 1.1 is now available for download with a brand new split view. The new BWSplitView has three main features:

  1. Subview autosizing: In the inspector, the developer can tell the split view which subviews should resize with the window and which should remain at a fixed size. The standard behavior of NSSplitView is to ignore the autosizing masks on the subviews and resize them proportionally as the split view resizes. This is not the desired behavior for most applications. BWSplitView honors each subview’s autoresizing mask which is easily configurable in both the BWSplitView inspector and the subview’s size inspector.
  2. Constraints: Each subview’s minimum and maximum size is configurable in the BWSplitView inspector. You can specify the size in points or as a percentage of the split view’s size.
  3. Collapsing: BWSplitView has powerful new collapsing functionality. A view marked as “collapsible” in the inspector will collapse when its divider has been double clicked and when the user tries to make the view smaller than its minimum size. You can also hook up a toggle button to the split view’s toggleCollapse: action which will collapse or expand the subview using Core Animation. The split view takes care of synchronizing its state with the toggle button, so the button never shows the opposite indication.

The reason I call the split view “codeless” is that for the vast majority of use cases, the developer will not have to write a single line of code to get the split view functionality they desire. For other use cases that do require something out of the ordinary, the developer can set themselves as the delegate on the split view and implement any relevant delegate methods.

In the video below, I create iCal’s split view layout, with maximum and minimum sizes for subviews, subview collapsing with animation, and proper autoresizing behavior, all within Interface Builder – and it takes less than 3 minutes.

iCal-style Interface
 
I’d love to hear your thoughts on the split view and any ideas you may have for improvements. Drop me a line or file a bug.

And a big thanks to Fraser Kuyvenhoven for developing the split view’s resizing algorithm.
 

Download BWToolkit

Source Code


Comments are closed.