Smooth spline calculation between keyframe values..
- iOS 4.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- Core Animation
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.
Listing 1 shows how to create a keyframe animation object using cubic interpolation.
A layer animated with the keyframe animation created by the code above and with linearly interpolated horizontal movement would describe a path similar to Figure 1.