Errata for SwiftUI Animations by Tutorials 1st Edition

Creating this topic to catch any typos and bugs in the 1st Edition of SwiftUI Animations by Tutorials.

Table of contents & p, 43, “Asynchronous” → “Asymmetric”.

Chapter 1, Using Asynchronous Transitions, I was very puzzled at what Asynchronous Transitions were going to be. Turns out you meant Asymmetric, which shows up as the correct Swift keyword. Asynchronous means “not at the same time”, e.g. for multitasking, if you trigger an action but don’t wait for it to complete. So maybe there were going to be asynchronous transitions. Asymmetric is “not symmetric” which is exactly what these are, behaving differently on the two sides of the transition.

Stoked to be first to point this out!

Chapter 2, p. 65, the task in calculateOffset(from:)'s .pulling case: I got a compilation error “cannot find in this scope” at the “timeForTheBallTo{Return,RollOut}” variables. I needed to put “Constants.” with them. I’m on Xcode 14.0.

Chapter 2, p. 66, (this is really picky and easy to overlook), just above the “.animation(” gray box,

“Add the following modifier
to after Ball’s offset”,

delete that “to”

Chapter 3, p. 74, if you’re picking up from chapter 2, in Constants.swift, before the gray box in “Getting Started”, you need to add “import SwiftUI”, presumably after “import Foundation”. It’s in the starter project for ch. 3, but not ch. 2; otherwise “Cannot find ‘Color’ in scope” error.

In the Challenge section for Chapter 1, TransitionTypeView.swift is missing from the starter project.

In chapter 10, “Recreating a Real-World animation”, it said that:

The origin is important to consider because a view’s bounds often don’t correspond to the whole screen’s bounds, and its origin can differ from the (0 , 0 ) point.

When it comes to AppKit and UIKit (thus to CoreGraphics), the bounds property of a view or a layer has always an origin of (0, 0). Is it different in SwiftUI or for the Layout protocol? If so then it would be a nice addition to mention this difference with the bounds naming in other and older UI frameworks.