<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKRepeatMode/clamp",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:@E@SKRepeatMode@SKRepeatModeClamp"
  },
  "title" : "SKRepeatMode.clamp"
}
-->

# SKRepeatMode.clamp

When a sample is calculated, the time value is clamped to the range of time values found in the sequence. For example, if the last keyframe’s time value is `0.5`, a sample at any time value from `0.5` to `1.0` returns the last keyframe’s value.

```
case clamp
```

## Discussion

Given a sequence with the key values of `[5, 1, 10]` and times of `[0, 0.25, 0.5]`, clamp repeat mode produces a set of values that follow straight line when the sample time is greater or equal to `0.5`:

![Playground graph generated by SKKeyframeSequence using clamp repeat mode](images/com.apple.spritekit/media-2576677@2x.png)

---

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)