Re: CALayer Transitions
Re: CALayer Transitions
- Subject: Re: CALayer Transitions
- From: Kyle Sluder <email@hidden>
- Date: Sun, 15 Nov 2009 20:27:05 -0800
On Sun, Nov 15, 2009 at 6:51 PM, Matt Neuburg <email@hidden> wrote:
> Your understanding is likely wrong. :) addAnimation:forKey: on a layer
> triggers the animation then and there. Look at the examples in the Animation
> section of the Core Animation Programming Guide.
To elaborate, the purpose of the key in -addAnimation:forKey: is so
that you can go back and refer to the animation later without having
to store it in some external data structure. Instead, it's hanging
right on the layer you attached it to. It's unfortunate that Core
Animation suffers from such a conflict of terminology here. They
really should have picked something else ("tag"?) to describe "handle
by which you can refer to an animation you previously attached to this
thing."
> For my money, the easiest way to set this up is to make self your
> contentLayer's delegate and implement actionForLayer:forKey:. So, assuming
> the delegation is already set up:
This is probably the easiest if you already have a delegate. If
you're doing a one-off animation here, you could get away with
aLayer.actions = [NSArray arrayWithObject:anAnimation];
--Kyle Sluder
_______________________________________________
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