NSAnimatablePropertyContainer
NSAnimatablePropertyContainer
- Subject: NSAnimatablePropertyContainer
- From: "I. Savant" <email@hidden>
- Date: Thu, 15 Nov 2007 22:22:15 -0500
List:
I'm finally playing around with Core Animation. I have a view which
(for simplicity sake) has two properties:
NSImage * imageToDisplay (default nil)
CGFloat imageAlpha (default 0.0)
I have the +defaultAnimationForKey: working fine. It dutifully
returns a well-formed CABasicAnimation per the example in the
NSAnimatablePropertyContainer protocol reference documentation.
I want to do something like this:
- (void)someMethodWithSomeImage:(NSImage *)image
{
[[myCustomView animator] setImageAlpha:0.0];
[myCustomView setImageToDisplay:image];
[[myCustomView animator] setImageAlpha:1.0];
}
When imageToDisplay is first set, the new image fades in from the
default 0.0 beautifully. Subsequent sets fail to animate (they go
straight to the new image). I *assume* this is because the animation
is non-blocking and by the time the first interpolated alpha value
gets set (and drawn) the custom view's imageToDisplay is already
something else.
I spent quite some time tonight trying to figure out how to set the
'blocking mode' as NSAnimation allows ( [someNSAnimation
setAnimationBlockingMode:NSAnimationBlocking] ) but CAAnimation,
CABasicAnimation, etc. don't seem to allow this.
Am I missing something or is it not possible to have a blocking
animation in this way?
--
I.S.
_______________________________________________
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