36.6 Automatically Starting an Animation
So far in this chapter, all the animations have been triggered by an event such as a button click. Often an animation will need to start without user interaction, for example when a view is first displayed to the user. Since an animation is triggered each time an animatable property of a view changes, this can be used to automatically start an animation when a view appears.
To see this technique in action, modify the example ContentView.swift file as follows:
struct ContentView : View {
var body: some View {
ZStack {
Circle()
.stroke(lineWidth: 2)
...