Episode #449

Customizing Animations with AnimatableVector

10 minutes
Published on July 23, 2020

This video is only available to subscribers. Get access to this video and 584 others.

If you can describe your animation with a small number of parameters that interpolate over the animation, animation is pretty easy. But once you want to combine an arbitrary number of animatable data values, for instance an array of Doubles representing our points, then you have to resort to a custom VectorArithmetic implementation. In this episode we will create an AnimatableVector type that is capable of animating between arrays of Double values. We then use this type to animate between 2 sets of points using our waveform algorithm.

This episode uses Swift 5.3, Ios 14.0-beta2, Xcode 12-beta2.