title: SwiftUI Chaning Animations
body: <p>I am trying to chain two animations in SwiftUI. However, the first animation does not animate when pressing the button. I found this approach of chaining animations here: <a href="https://stackoverflow.com/questions/56907344/chaining-animations-in-swiftui">Chaining animations in SwiftUI</a></p>
  <pre class="lang-swift prettyprint-override"><code>struct FancyButtonViewModel: View {
      @State var movementY:CGFloat = 0
      
      var body: some View {
          VStack{
              Text(&quot;&quot;)
                  .offset(y: movementY)
              Button(&quot;Press Me&quot;){
                  withAnimation(Animation.easeOut(duration: 0.5)) {
                      movementY = -150
                  }
                  withAnimation(Animation.easeIn(duration: 3).delay(0.5)) {
                      movementY = 0
                  }
              }
  
          }
      }
  }
  </code></pre>