Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/QuartzCore.framework |
Availability | Available in Mac OS X v10.5 and later. |
Declared in | CAAnimation.h |
Companion guides |
CAKeyframeAnimation
provides generic keyframe animation capabilities for a layer property in the render tree. You create an CAKeyframeAnimation
instance using the inherited animationWithKeyPath:
method, specifying the key path of the property updated in the render tree during the animation. The animation provides a series of keyframe values, either as an array or a series of points in a CGPathRef
. While animating, it updates the value of the property in the render tree with values calculated using the specified interpolation calculation mode.
keyTimes
property
timingFunctions
property
calculationMode
property
rotationMode
property
For more about Objective-C properties, see “Properties” in The Objective-C 2.0 Programming Language.
Specifies how intermediate keyframe values are calculated by the receiver.
@property(copy) NSString *calculationMode
The possible values are described in “Value calculation modes”
. The default is kCAAnimationLinear
.
CAAnimation.h
An optional array of NSNumber
objects that define the duration of each keyframe segment.
@property(copy) NSArray *keyTimes
Each value in the array is a floating point number between 0.0 and 1.0 and corresponds to one element in the values array. Each element in the keyTimes
array defines the duration of the corresponding keyframe value as a fraction of the total duration of the animation. Each element value must be greater than, or equal to, the previous value.
The appropriate values in the keyTimes
array are dependent on the calculationMode
property.
If the calculationMode is set to kCAAnimationLinear
, the first value in the array must be 0.0 and the last value must be 1.0. Values are interpolated between the specified keytimes.
If the calculationMode is set to kCAAnimationDiscrete
, the first value in the array must be 0.0.
If the calculationMode is set to kCAAnimationPaced
, the keyTimes
array is ignored.
If the values in the keyTimes
array are invalid or inappropriate for the calculationMode
, the keyTimes
array is ignored.
CAAnimation.h
An optional CGPathRef
that provides the keyframe values for the receiver.
@property CGPathRef path;
Defaults to nil
. Specifying a path overrides the values
property. Each point in the path, except for moveto points, defines a single keyframe segment for the purpose of timing and interpolation. For constant velocity animation along the path, calculationMode
should be set to kCAAnimationPaced
.
CAAnimation.h
Determines whether objects animating along the path rotate to match the path tangent.
@property(copy) NSString *rotationMode
Possible values are described in “Rotation Mode Values”
. The default is nil
, which indicates that objects should not rotate to follow the path.
The effect of setting this property to a non-nil
value when no path object is supplied is undefined.
CAAnimation.h
An optional array of CAMediaTimingFunction
instances that defines the pacing of the each keyframe segment.
@property(copy) NSArray *timingFunctions
If the receiver defines n keyframes, there must be n-1 objects in the timingFunctions
array. Each timing function describes the pacing of one keyframe to keyframe segment.
The inherited timingFunction
value is always ignored.
CAAnimation.h
An array of objects that provide the keyframe values for the receiver.
@property(copy) NSArray *values
The values
property is ignored when the path
property is used.
CAAnimation.h
These constants are used by the rotationMode
property.
NSString * const kCAAnimationRotateAuto NSString * const kCAAnimationRotateAutoReverse
kCAAnimationRotateAuto
The objects travel on a tangent to the path.
Available in Mac OS X v10.5 and later.
Declared in CAAnimation.h
.
kCAAnimationRotateAutoReverse
The objects travel at a 180 degree tangent to the path.
Available in Mac OS X v10.5 and later.
Declared in CAAnimation.h
.
CAAnimation.h
These constants are used by the calculationMode
property.
NSString * const kCAAnimationLinear; NSString * const kCAAnimationDiscrete; NSString * const kCAAnimationPaced;
kCAAnimationLinear
Simple linear calculation between keyframe values.
Available in Mac OS X v10.5 and later.
Declared in CAAnimation.h
.
kCAAnimationDiscrete
Each keyframe value is used in turn, no interpolated values are calculated.
Available in Mac OS X v10.5 and later.
Declared in CAAnimation.h
.
kCAAnimationPaced
Keyframe values are interpolated to produce an even pace throughout the animation. This mode is not currently implemented
Available in Mac OS X v10.5 and later.
Declared in CAAnimation.h
.
CAAnimation.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-07-24)