SwiftUI Animations Mastery book updated for iOS 15

Mark Moeykens
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.)



Learn More

If you're interested in the book then head over to learn more about it here.

6 comments

Neil Wiseman
Oct 25, 2021
Already updated my collection. 
Mark Moeykens
Oct 26, 2021
Awesome! 🙌
Mark Nair
Oct 27, 2021
Hey Mark, will you include this update for the Explorer's Club?
Mark Nair
Oct 27, 2021
Great. Thank you!
Robert McGovern
Nov 1, 2021
Just waiting on a payment and the. I’ll be upgrading the book.