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.