CocoaDev

Edit AllPages

Animating

== Using -animator Proxy ==

Here’s a method written for a subclass using vertical dividers. Obviously this can be edited to be used in a controller object – and two more lines of code can add support for horizontal dividers.

I should also mention that for some reason -splitView:resizeSubviewsWithOldSize: gets repeated called during the animation, even though the splitView isn’t being resized. This may or may not be what you want, so you may want to check NSEqualSizes( sender.frame.size, oldSize) at the beginning of the function. – Jeffrey

== Using NSViewAnimation ==

== Another With NSViewAnimation ==

This code also works; put it in a subclass of NSSplitView.

// Unhides both subviews and changes the splitter position, possibly // with animation. This method’s behavior is undefined if there are not // exactly two subviews. Note that the delegate must call // -setNeedsDisplay:YES whenever -isSplitterAnimating returns YES.

// Only works with two subviews.

///////////// [[NSSplitView delegate