<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/CubicKeyframe",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI13CubicKeyframeV"
  },
  "title" : "CubicKeyframe"
}
-->

# CubicKeyframe

A keyframe that uses a cubic curve to smoothly interpolate between values.

```
struct CubicKeyframe<Value> where Value : Animatable
```

## Overview

If you don’t specify a start or end velocity, SwiftUI automatically
computes a curve that maintains smooth motion between keyframes.

Adjacent cubic keyframes result in a Catmull-Rom spline.

If a cubic keyframe follows a different type of keyframe, such as a linear
keyframe, the end velocity of the segment defined by the previous keyframe
will be used as the starting velocity.

Likewise, if a cubic keyframe is followed by a different type of keyframe,
the initial velocity of the next segment is used as the end velocity of the
segment defined by this keyframe.

## Topics

### Creating the keyframe

[`init(_:duration:startVelocity:endVelocity:)`](/documentation/SwiftUI/CubicKeyframe/init(_:duration:startVelocity:endVelocity:))

Creates a new keyframe using the given value and timestamp.



---

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)