๐ฐimplicit vs. explicit
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.
An implicit animation is part of the view tree: by adding .animation() to a view, any change to that view is automatically animated.
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.
Last updated