On Sun, Nov 15, 2009 at 6:51 PM, Matt Neuburg <m...@tidbits.com> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to