An object that performs interpolation between values specified at different times (keyframes).


@interface SKKeyframeSequence : NSObject


The primary use for an SKKeyframeSequence object is to animate properties on particles emitted by an SKEmitterNode object, but it can also be used for your general interpolation needs across a discrete set of inputs.

When a keyframe sequence is used with an emitter node, particles determine their values by sampling the keyframe sequence. The sequence replaces the normal simulation performed by the emitter node.


First Steps

Using Keyframe Sequence to effect Custom Interpolation

See a few examples of what keyframe sequence can do.

- initWithKeyframeValues:times:

Initializes a keyframe sequence with an initial set of values and times.

- initWithCapacity:

Initializes a new keyframe sequence.

Sequence Building

Define the composition of the keyframe sequence.

- addKeyframeValue:time:

Adds a keyframe to the sequence.

- removeKeyframeAtIndex:

Removes a keyframe from the sequence.

- removeLastKeyframe

Removes the last value in the sequence.

- setKeyframeTime:forIndex:

Changes the time for a specific keyframe.

- setKeyframeValue:forIndex:

Changes the value for a specific keyframe.

- setKeyframeValue:time:forIndex:

Replaces a keyframe in the sequence with a new keyframe.

Sequence Running

You run the sequence by sampling its output at a given time.

- sampleAtTime:

Calculates the sample at a particular time.

Sequence Information

- count

The number of keyframes in the sequence.

- getKeyframeTimeForIndex:

Gets the time for a keyframe in the sequence.

- getKeyframeValueForIndex:

Gets the value for a keyframe in the sequence.

Interpolation Modifiers

Modify sample output by defining a mode or repeat options.


The mode used to determine how values for times between the keyframes are calculated.


The mode used to determine how the keyframe sequence repeats.



The modes used to interpolate between keyframes in the sequence.


The modes used to determine how the sequence repeats.


Inherits From

See Also

Mathematical Tools


A definition of a range of floating-point values.


The definition of an arbitrary area.