title: How to pause an animation in SwiftUI?
body: <p>I don't know how to stop <code>withAnimation(_:)</code> method after starting it.</p>
  
  <p>I am writing my first app with SwiftUI and I want to create a progress circle, which will be controlled with buttons by user - start button, which will start animation, where circle will be unfilled at the end and stop button will have to save actual state of the fill point and stop the animation.</p>
  
  <p>My main view:</p>
  
  <pre><code>struct MainView: View {
    @State private var fillPoint = 1.0 
    @State private var animationDuration = 10.0
  
    private var ring: Ring {
      let ring = Ring(fillPoint: self.fillPoint)
      return ring
    }
  
    var body: some View {
      VStack {
        ring.stroke(Color.red, lineWidth: 15.0)
          .frame(width: 200, height: 200)
          .padding(40)
        HStack {
          Button(action: {
            withAnimation(.easeIn(duration: self.animationDuration)) {
                self.fillPoint = 0
            }
          }) {
            Text("Start")
          }
          Button(action: {
            // what should I do here?
          }) {
            Text("Stop")
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>And Ring's struct:</p>
  
  <pre><code>struct Ring: Shape {
    var startArcAngle: Double = 360.0
  
    var fillPoint: Double {
      willSet {
        startArcAngle = 360 * newValue
      }
    }
  
    internal var animatableData: Double {
      get { return fillPoint }
      set { fillPoint = newValue }
    }
  
    internal func path(in rect: CGRect) -&gt; Path {
      let endArcAngle = 0.0
  
      var path = Path()
  
      path.addArc(center: CGPoint(x: rect.size.width / 2,
                                  y: rect.size.height / 2),
                  radius: rect.size.width / 2,
                  startAngle: .degrees(startArcAngle - 90),
                  endAngle: .degrees(endArcAngle - 90),
                  clockwise: true)
  
      return path
    }
  }
  </code></pre>
  
  <p>I've tried to manipulate <code>animatableData</code> value, but outside Ring's struct it's always returning 0.0 (value which is my code going to achieve at the end of animation if it's started) and inside Ring's struct it prints as I would like (0.96xxxx -> 0.94xxxx, etc.), but taking this outside of Ring's struct always returns 1.0 or 0.0.</p>