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.

Tasks

Getting Value Function Properties

Creating and Initializing Value Functions

Properties

name

Returns the name of the value function. (read-only)

@property(readonly) NSString *name
Availability
  • Available in iOS 3.0 and later.
Declared In
CAValueFunction.h

Class Methods

functionWithName:

Returns the value function object identified by the name.

+ (id)functionWithName:(NSString *)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.h

Constants

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
kCAValueFunctionRotateX

A 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.

kCAValueFunctionRotateY

A 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.

kCAValueFunctionRotateZ

A 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
kCAValueFunctionScale

A value function scales by the input value along all three axis. Animations using this value transform function must provide animation values in an NSArray of three NSNumber instances that specify the (x, y, z) scale values.

Available in iOS 3.0 and later.

Declared in CAValueFunction.h.

kCAValueFunctionScaleX

A 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.

kCAValueFunctionScaleY

A 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.

kCAValueFunctionScaleZ

A 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
kCAValueFunctionTranslate

A value function that translates by the input values along all three axis. Animations using this value transform function must provide animation values in an NSArray of three NSNumber instances that specify the (x, y, z) translate values.

Available in iOS 3.0 and later.

Declared in CAValueFunction.h.

kCAValueFunctionTranslateX

A 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.

kCAValueFunctionTranslateY

A 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.

kCAValueFunctionTranslateZ

A 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.