9.4 · Implicit and explicit animation, UIView animation, and animators
Every UIKit animation ends up as a Core Animation animation on a layer. Once you know the model-versus-presentation rule, the different APIs are just different ways of saying the same thing.
Mental model. You change a model value; Core Animation animates the presentation toward it. The APIs differ only in who creates the animation and how much control you get.
Core Animation and UIKit
Implicit, explicit and the UIView wrappers.
- How do implicit and explicit animations differ in Core Animation, and how does CATransaction fit in?
An implicit animation happens automatically: change an animatable property of a standalone CALayer and Core Animation animates from the old to the new value… - How do UIView.animate, UIViewPropertyAnimator and SwiftUI’s animations relate, and when do you pick each?
UIView.animate(withDuration:…) (and its spring, keyframe and transition variants) is the simplest: set the end state inside the closure, and UIKit creates the…
More in Layout, rendering & animation
- 9.1 · Auto Layout, intrinsic size, and when layoutSubviews and draw run
- 9.2 · From layout to the GPU, and the two layer trees
- 9.3 · Offscreen passes, rasterization, blending, shadows and masks
- 9.5 · Core Graphics, UIBezierPath and draw(_:)
- 9.6 · TextKit 1 and 2, and Text in SwiftUI
- 9.7 · Frame budgets, ProMotion, hitches and hangs
- 9.8 · Margins, stack views, guides, constraint ownership, the layout cycle and measuring
- 9.9 · Coordinate conversion, 3D transforms and layer contents
- 9.10 · How UIView animation really works, springs, timing and display links
- 9.11 · Transform order, fill rules, text measurement, text containers and bitmaps
- 9.12 · Rectangle containment and moving a point between coordinate spaces