CAAnimation
CAAnimation Class Reference
Overview
CAAnimation is an abstract animation class. It provides the basic support for the CAMediaTiming and CAAction protocols.
Tasks
Archiving Properties
Providing Default Values for Properties
Creating an Animation
Animation Attributes
-
removedOnCompletionproperty -
timingFunctionproperty
Getting and Setting the Delegate
-
delegateproperty
Animation Progress
-
– animationDidStart:delegate method -
– animationDidStop:finished:delegate method
Properties
delegate
Specifies the receiver’s delegate object.
Discussion
Defaults to nil.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.hremovedOnCompletion
Determines if the animation is removed from the target layer’s animations upon completion.
Discussion
When YES, the animation is removed from the target layer’s animations once its active duration has passed. Defaults to YES.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.htimingFunction
An optional timing function defining the pacing of the animation.
Discussion
Defaults to nil, indicating linear pacing.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.hClass Methods
animation
Creates and returns a new CAAnimation instance.
Return Value
An CAAnimation object whose input values are initialized.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.hdefaultValueForKey:
Specifies the default value of the property with the specified key.
Parameters
- key
-
The name of one of the receiver’s properties.
Return Value
The default value for the named property. Returns nil if no default value has been set.
Discussion
If this method returns nil a suitable “zero” default value for the property is provided, based on the declared type of the key. For example, if key is a CGSize object, a size of (0.0,0.0) is returned. For a CGRect an empty rectangle is returned. For CGAffineTransform and CATransform3D, the appropriate identity matrix is returned.
Special Considerations
If key is not a known for property of the class, the result of the method is undefined.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.hInstance Methods
shouldArchiveValueForKey:
Specifies whether the value of the property for a given key is archived.
Parameters
- key
-
The name of one of the receiver’s properties.
Return Value
YES if the specified property should be archived, otherwise NO.
Discussion
Called by the object's implementation of encodeWithCoder:. The object must implement keyed archiving.
The default implementation returns YES.
Availability
- Available in iOS 4.0 and later.
Declared In
CAAnimation.hDelegate Methods
animationDidStart:
Called when the animation begins its active duration.
Parameters
- theAnimation
-
The
CAAnimationinstance that started animating.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.hanimationDidStop:finished:
Called when the animation completes its active duration or is removed from the object it is attached to.
Parameters
- theAnimation
-
The
CAAnimationinstance that stopped animating. - flag
-
If
YES, the animation reached the end of its active duration without being removed.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.h

浙公网安备 33010602011771号