---
title: "init(_:duration:startVelocity:endVelocity:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/cubickeyframe/init(_:duration:startvelocity:endvelocity:)"
---

# init(_:duration:startVelocity:endVelocity:)

Creates a new keyframe using the given value and timestamp.

## Declaration

```swift
init(_ to: Value, duration: TimeInterval, startVelocity: Value? = nil, endVelocity: Value? = nil)
```

## Parameters

- `to`: The value of the keyframe.
- `duration`: The duration of the segment defined by this keyframe.
- `startVelocity`: The velocity of the value at the beginning of the segment, or nil to automatically compute the velocity to maintain smooth motion.
- `endVelocity`: The velocity of the value at the end of the segment, or nil to automatically compute the velocity to maintain smooth motion.
