---
title: cubic
framework: quartzcore
role: symbol
role_heading: Type Property
path: quartzcore/caanimationcalculationmode/cubic
---

# cubic

Smooth spline calculation between keyframe values.

## Declaration

```swift
static let cubic: CAAnimationCalculationMode
```

## Discussion

Discussion Intermediate frames are computed using a Catmull-Rom spline that passes through the keyframes. You can adjust the shape of the spline by specifying an optional set of tension, continuity, and bias values, which modify the spline using the standard Kochanek-Bartels form. The following code shows how to create a keyframe animation object using cubic interpolation. let keyframeAnimation = CAKeyframeAnimation(keyPath: "position.y") keyframeAnimation.calculationMode = kCAAnimationCubic keyframeAnimation.keyTimes = [0, 0.25, 0.5, 0.75, 1] keyframeAnimation.values = [310, 60, 120, 60, 310] A layer animated with the keyframe animation created by the code above and with linearly interpolated horizontal movement would describe a path similar to the following figure.

## See Also

### Constants

- [linear](quartzcore/caanimationcalculationmode/linear.md)
- [discrete](quartzcore/caanimationcalculationmode/discrete.md)
- [paced](quartzcore/caanimationcalculationmode/paced.md)
- [cubicPaced](quartzcore/caanimationcalculationmode/cubicpaced.md)
