Class

CAAnimation

The abstract superclass for animations in Core Animation.

Declaration

@interface CAAnimation : NSObject

Overview

CAAnimation provides the basic support for the CAMediaTiming and CAAction protocols. You do not create instance of CAAnimation: to animate Core Animation layers or SceneKit objects, create instances of the concrete subclasses CABasicAnimation, CAKeyframeAnimation, CAAnimationGroup, or CATransition.

Animating Core Animation Layers

You can animate the contents of your iOS or macOS app’s user interface by attaching animations to CALayer objects. For more information, see Core Animation Programming Guide.

Animating Scene Kit Content

In Scene Kit, animation objects represent not only property-based animations, but also animations of geometry data created with external 3D authoring tools and loaded from a scene file. You use the properties of the CAAnimation object representing a geometry animation to control its timing, monitor its progress, and attach actions for Scene Kit to trigger during the animation. You can attach animations to Scene Kit objects that adopt the SCNAnimatable protocol, including nodes, geometries, and materials.

In a Scene Kit app, CAAnimation objects support additional methods and properties, listed under Controlling SceneKit Animation Timing, Fading between SceneKit Animations, and Attaching SceneKit Animation Events.

Topics

Creating an Animation

+ animation

Creates and returns a new CAAnimation instance.

+ animationWithSCNAnimation:

Creates an animation from a SceneKit animation.

Animation Attributes

removedOnCompletion

Determines if the animation is removed from the target layer’s animations upon completion.

timingFunction

An optional timing function defining the pacing of the animation.

Providing Default Values

+ defaultValueForKey:

Specifies the default value of the property with the specified key.

Designating a Delegate

delegate

Specifies the receiver’s delegate object.

Archiving Properties

- shouldArchiveValueForKey:

Specifies whether the value of the property for a given key is archived.

Controlling SceneKit Animation Timing

usesSceneTimeBase

For animations attached to SceneKit objects, a Boolean value that determines whether the animation is evaluated using the scene time or the system time.

Fading between SceneKit Animations

fadeInDuration

For animations attached to SceneKit objects, the duration for transitioning into the animation’s effect as it begins.

fadeOutDuration

For animations attached to SceneKit objects, the duration for transitioning out of the animation’s effect as it ends.

Attaching SceneKit Animation Events

animationEvents

For animations attached to SceneKit objects, a list of events attached to an animation.

Relationships

Inherits From

See Also

Animation

CAAnimationDelegate

Methods your app can implement to respond when animations start and stop.

CAPropertyAnimation

An abstract subclass of CAAnimation for creating animations that manipulate the value of layer properties.

CABasicAnimation

An object that provides basic, single-keyframe animation capabilities for a layer property.

CAKeyframeAnimation

An object that provides keyframe animation capabilities for a layer object.

CASpringAnimation

An animation that applies a spring-like force to a layer's properties.

CATransition

An object that provides an animated transition between a layer's states.

CAValueFunction

An object that provides a flexible method of defining animated transformations.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software