I cannot understand the section “Animations vs. real content” in Ch. 8. I mean, all code works fine with fillMode = kCAFillModeBoth and default isRemovedOnCompletion = true, 'cause we already start with textview on the center of the superview.
This is not true:
To start, remember you’re setting the text field to be positioned offscreen in viewWillAppear(_:):
'Cause of this:
Scroll to viewWillAppear() and remove the following line: username.center.x -= view.bounds.width
And I can’t understand this:
You removed the line that sets fromValue some time ago, but the code above updates the main layer’s position; this causes the animation to start from the center of the screen. To fix this, add the following line just after you initialize flyRight and set its toValue:
flyRight.fromValue = -view.bounds.size.width/2
We are talking of the toValue but the code present fromValue…