implicit vs. explicit
Last updated
Was this helpful?
Last updated
Was this helpful?
implicit: use view.animation()
, SwiftUI will automatically render the animation based on the state changes of the view.
explicit: tell SwiftUI what state changes you want to animate inside the withAnimation()
block.
we create an animatable view by calling .animation() on a view. When we create an implicit animation, anytime the view tree is recomputed, changes of animatable properties in this view tree are animated.