Animation curve is the change of animation speed over time. In other words, when you animate a property, the value gets interpolated using an interpolation function.
For example, if you have one second animation with animation curve as easeInOut, the animation will start slow, speed up in the middle and slow down before completion towards the end. EaseInOut is represented in the graph as shown below:
Having just one animation curve doesn’t give us a clear picture on interpolation change so let’s put a few of them together so we can see the difference.
Other animation curves on graph look like this:
Linear:
EaseIn:
EaseOut:
Default(EaseInOut):
Spring:
Note: animation curves are different but animation starts and ends at the same time.
SwiftUI animations are interactive, meaning if we trigger animation while another animation is playing SwiftUI accommodates changes from new trigger as well.
To see this in action, I will run the animation again and when our planes are midway, I will tap on VStack again to send them back.
With that we have reached the end of this article. Thank you once again for reading. Subscribe to our weekly newsletter at https://www.devtechie.com