Animating NSSplitViewItem with CAAnimation
Animating NSSplitViewItem with CAAnimation
- Subject: Animating NSSplitViewItem with CAAnimation
- From: Dragan Milić <email@hidden>
- Date: Wed, 20 May 2015 10:17:09 +0200
I’m trying to use SplitViewController/NSSplitViewItem (both new in OS X 10.10) objects combo to control NSSplitView instances in my application.
First off, even though I’ve got the latest version of Apple documentation installed, it completely omits NSSplitViewItem reference. That class is only mentioned in explanations of related methods of NSSplitViewController, but it’s nowhere really documented. I had to resort to class-dumping the AppKit in order to find out it’s interface. I’ll definitely file a bug for this.
Now, into the subject. NSSplitViewItem implements NSAnimatablePropertyContainer protocol, which means one can use its animator proxy to animate animatable properties. The properly I’m interested in is “collapsed”, so that I can simultaneously animate collapsing/uncollapsing of a couple of subviews/item of the split view. I can easily do that using NSAnimationContext and running animation group(s) with completion handler(s). However, I need more control over animation execution. For example, it may happen a new animation is about to start before while the previous one is still in progress. In such case I need to interrupt/stop the previous animation before starting a new one. There are other situations as well, which require more tight control over animation execution. Simple NSAnimationContext animation group running doesn’t provide such flexibility, so I want to add/remove CAAnimation instances directly. However, NSSplitViewItem doesn’t have any CALayer backing up, so I don’t know how to use CAAnimation with it.
Does anyone know more about this?
-- Dragan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden