---
title: "init(keyframeValues:times:)"
framework: spritekit
role: symbol
role_heading: Initializer
path: "spritekit/skkeyframesequence/init(keyframevalues:times:)"
---

# init(keyframeValues:times:)

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

## Declaration

```swift
init(keyframeValues values: [Any], times: [NSNumber])
```

## Parameters

- `values`: An array of value objects that define the keyframe values for the sequence.
- `times`: An array of doc://com.apple.documentation/documentation/Foundation/NSNumber objects containing floating-point values that specify the time values for the keyframes.

## Return Value

Return Value A newly initialized sequence.

## Discussion

Discussion The two arrays must have an identical number of elements. The keyframes in the new sequence are stored in the same order as the input arrays.

## See Also

### First Steps

- [Using Keyframe Sequence to effect Custom Interpolation](spritekit/using-keyframe-sequence-to-effect-custom-interpolation.md)
- [init(capacity:)](spritekit/skkeyframesequence/init(capacity:).md)
- [init(coder:)](spritekit/skkeyframesequence/init(coder:).md)
