So we think this is pretty incredible. We are now able to animate any kind of state change that happens in the Composable Architecture, whether it be from sending an action to the store directly, or if a binding makes a change to state, or if state is changed from an asynchronous effect that feeds data back into the system. All of it can be animated, and you can choose when and how the animation happens. And we did all of this without making a single change to the core Composable Architecture library. You could have added all of this functionality to your code base without waiting for us to add the functionality. This is the power of having small, un-opinionated, composable units to build your applications with.
So we’ve accomplished what we set out to do, which was unlock all of the amazing animation capabilities of SwiftUI for the Composable Architecture. There’s no type of animation that one can do in vanilla SwiftUI that we can’t also do in the Composable Architecture, and it all boiled down to a simple transformation that is performed on schedulers.
But we like to end our episodes by asking “what’s the point?”. This is our opportunity to bring things down to earth and show more real world applications of the concepts we are discussing. Now the concepts we are discussing are already pretty rooted in reality, having just fixed a deficiency in the Composable Architecture when dealing with animations, but that doesn’t mean we can’t go a little deeper.
We are going to explore two additional facets of animations and schedulers.
First, there may be a chance that some of our viewers don’t have much interest in the Composable Architecture, and they like to build their applications using view models or some other style. That’s quite alright, we know it isn’t for everyone. However, this concept of transforming schedulers into animatable schedulers is applicable to vanilla SwiftUI, even UIKit(!), and so we’d like to demonstrate that.
Second, as most of our viewers know by now, we are currently building an application in the Composable Architecture that will be released soon. It’s called isowords and it’s a word game. This is a large, real world code base consisting of both a client and a server component, both written in Swift. So we’d like to take a moment to demonstrate a few places we can make use of this new
.animation
operator.
Let’s get started.