36.4 Explicit Animation
As previously discussed, implicit animation using the animation() modifier implements animation on any of the animatable properties on a view that appear before the animation modifier. SwiftUI provides an alternative approach referred to as explicit animation which is implemented using the withAnimation() closure. When using explicit animation, only the property changes that take place within the withAnimation() closure will be animated. To experience this in action, modify the example so that the rotation effect is performed within a withAnimation() closure and remove the animation() modifier:
var body: some View {
Button(action: { withAnimation(.linear (duration: 2)) {
self.rotation =
(self.rotation < 360 ? self.rotation + 60 : 0)
...