CAValueFunction Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/QuartzCore.framework |
| Availability | Available in iOS 3.0 and later. |
| Declared in | CAValueFunction.h |
| Companion guides |
Overview
The CAValueFunction.h class provides a more flexible means of applying functions to property values during animation. A value function defines an optional transformation that is applied to the interpolated value before it is set in the presentation layer.
Using value transform functions, animations can effect the transform property of a layer using arbitrary transforms of each component (no normalization to 360°) and concatenate in the normally when multiple animations are applied at once.
You use a value transform function that rotates from 0° to 180° around the z-axis by creating a CAValueTransform function specifying the kCAValueFunctionRotateZ and then creating an animation with a fromValue of 0, a toValue of M_PI, and set the animation’s valueTransform property to the value transform instance.
Properties
name
Returns the name of the value function. (read-only)
Availability
- Available in iOS 3.0 and later.
Declared In
CAValueFunction.hClass Methods
functionWithName:
Returns the value function object identified by the name.
Parameters
- name
The name of the value function.
Return Value
A new CAValueFunction instance with the value function specified by the name.
Discussion
The possible values for name are specified in “Rotate Value Functions,” “Scale Value Functions,” and “Translate Functions.”
Availability
- Available in iOS 3.0 and later.
Declared In
CAValueFunction.hConstants
Rotate Value Functions
Rotate value transform functions construct a 4x4 matrix that represents the corresponding rotation matrix.
NSString * const kCAValueFunctionRotateX; NSString * const kCAValueFunctionRotateY; NSString * const kCAValueFunctionRotateZ;
Constants
kCAValueFunctionRotateXA value function that rotates by the input value, in radians, around the x-axis. This value function expects a single input value.
Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.kCAValueFunctionRotateYA value function that rotates by the input value, in radians, around the y-axis. This value function expects a single input value.
Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.kCAValueFunctionRotateZA value function that rotates by the input value, in radians, around the z-axis. This value function expects a single input value.
Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.
Scale Value Functions
Scale value transform functions construct a 4x4 matrix that represents the corresponding scale matrix.
NSString * const kCAValueFunctionScale; NSString * const kCAValueFunctionScaleX; NSString * const kCAValueFunctionScaleY; NSString * const kCAValueFunctionScaleZ;
Constants
kCAValueFunctionScaleA value function scales by the input value along all three axis. Animations using this value transform function must provide animation values in an
NSArrayof threeNSNumberinstances that specify the (x, y, z) scale values.Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.kCAValueFunctionScaleXA value function scales by the input value along the x-axis. Animations referencing this value transform function must provide a single animation value.
Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.kCAValueFunctionScaleYA value function scales by the input value along the y-axis. Animations referencing this value function must provide a single animation value.
Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.kCAValueFunctionScaleZA value function that scales by the input value along the z-axis. Animations referencing this value function must provide a single animation value.
Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.
Translate Functions
Translate value transform functions construct a 4x4 matrix that represents the corresponding translate matrix.
NSString * const kCAValueFunctionTranslate; NSString * const kCAValueFunctionTranslateX; NSString * const kCAValueFunctionTranslateY; NSString * const kCAValueFunctionTranslateZ;
Constants
kCAValueFunctionTranslateA value function that translates by the input values along all three axis. Animations using this value transform function must provide animation values in an
NSArrayof threeNSNumberinstances that specify the (x, y, z) translate values.Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.kCAValueFunctionTranslateXA value function translates by the input value along the x-axis. Animations referencing this value function must provide a single input value.
Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.kCAValueFunctionTranslateYA value function translates by the input value along the y-axis. Animations referencing this value function must provide a single input value.
Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.kCAValueFunctionTranslateZA value function translates by the input value along the z-axis. Animations referencing this value function must provide a single input value.
Available in iOS 3.0 and later.
Declared in
CAValueFunction.h.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-05-18)