SwiftUI Animations Mastery book updated for iOS 15
Mark Moeykens
Mark Moeykens
Big Mountain Studio was started by Mark Moeykens. The company specializes in providing visual picture books to be used as a reference.
Oct 25, 2021
Whew, finally, it's been about 2 months since I started updating the SwiftUI Animations Mastery book and it's finally ready.
Why did it take so long?
I didn't anticipate there to be such a large rewrite but the main animation modifier was deprecated in iOS 15!
The Xcode project had over 300 warnings. So, I had to go through and update the Xcode project with the new default animation modifier or change the animation method or fix or rearrange the view to be able to do the same animation.
It was a lot of work. Almost every single page had to be updated.
And then I thought, "Well since I'm practically updating every single file, I might as well update everything!"
This included updating all the little things like edgesIgnoringSafeArea to ignoresSafeArea and removing "self." from everywhere it was not needed.
Transitions Chapter
The transitions chapter also took a lot of work. Many of the transition animations appeared to not be working anymore.
It turned out it was just the Preview canvas or the Simulator that would not accurately render the animation.
I found some ways to fix this and updated the book. Here's one option:
Matched Geometry Effect Chapter Rewritten
Many of you know my love/hate relationship with matchedGeometryEffect.
Well, when testing all the pages I discovered many aspects of using matchedGeometryEffect no longer working with lists/scrollview/lazy stacks & grids. Ughhh!!!
This took a lot of research to find a way in which it would finally work again and I'm really happy with it. As a result, the chapter is greatly simplified to bring you the simplest and most workable solutions.
New AnimatableData Chapter
I also added a new chapter! The book now goes over how to expose properties of custom shapes so SwiftUI knows how to animate them.
If you have watched the SwiftUI Live Shape Series then you're probably familiar with how to do this.
I also cover other topics like AnimatablePair for exposing multiple properties and how to nest them.
There's also an example of combining Animatable and ViewModifier to create your own custom animatable modifiers. (Note: In iOS 15 AnimatableModifier was deprecated. Now you just combine Animatable and ViewModifier.)
Neil Wiseman
Mark Moeykens
Mark Nair
Mark Nair
Robert McGovern