Instance Method


Add the specified animation object to the layer’s render tree.


- (void)addAnimation:(CAAnimation *)anim forKey:(NSString *)key;



The animation to be added to the render tree. This object is copied by the render tree, not referenced. Therefore, subsequent modifications to the object are not propagated into the render tree.


A string that identifies the animation. Only one animation per unique key is added to the layer. The special key kCATransition is automatically used for transition animations. You may specify nil for this parameter.


If the duration property of the animation is zero or negative, the duration is changed to the current value of the kCATransactionAnimationDuration transaction property (if set) or to the default value of 0.25 seconds.

See Also

Layer Animations

- animationForKey:

Returns the animation object with the specified identifier.

- removeAllAnimations

Remove all animations attached to the layer.

- removeAnimationForKey:

Remove the animation object with the specified key.

- animationKeys

Returns an array of strings that identify the animations currently attached to the layer.