<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKKeyframeSequence/setKeyframeValue(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKKeyframeSequence(im)setKeyframeValue:forIndex:"
  },
  "title" : "setKeyframeValue(_:for:)"
}
-->

# setKeyframeValue(_:for:)

Changes the value for a specific keyframe.

```
func setKeyframeValue(_ value: Any, for index: Int)
```

## Parameters

`value`

The new value for the keyframe.

`index`

The index of the keyframe to change.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)