Class

CAKeyframeAnimation

The CAKeyframeAnimation class provides keyframe animation capabilities for a layer object. You create an CAKeyframeAnimation object using the inherited init(keyPath:) method, specifying the key path of the property that you want to animate on the layer. You can then specify the keyframe values to use to control the timing and animation behavior.

Overview

For most types of animations, you specify the keyframe values using the values and keyTimes properties. During the animation, Core Animation generates intermediate values by interpolating between the values you provide. When animating a value that is a coordinate point, such as the layer’s position, you can specify a path for that point to follow instead of individual values. The pacing of the animation is controlled by the timing information you provide.

Symbols

Providing keyframe values

var values: [Any]?

An array of objects that specify the keyframe values to use for the animation.

var path: CGPath?

The path for a point-based property to follow.

Keyframe timing

var keyTimes: [NSNumber]?

An optional array of NSNumber objects that define the time at which to apply a given keyframe segment.

var timingFunctions: [CAMediaTimingFunction]?

An optional array of CAMediaTimingFunction objects that define the pacing for each keyframe segment.

var calculationMode: String

Specifies how intermediate keyframe values are calculated by the receiver.

Rotation Mode Attribute

var rotationMode: String?

Determines whether objects animating along the path rotate to match the path tangent.

Cubic Mode Attributes

var tensionValues: [NSNumber]?

An array of NSNumber objects that define the tightness of the curve.

var continuityValues: [NSNumber]?

An array of NSNumber objects that define the sharpness of the timing curve’s corners.

var biasValues: [NSNumber]?

An array of NSNumber objects that define the position of the curve relative to a control point.

Constants

Rotation Mode Values

These constants are used by the rotationMode property.

Value calculation modes

These constants are used by the calculationMode property.

Relationships

Inherits From