0

I created a simple Rive animation that I would like played when my app is opened. The question is - how do I programmatically find out when the Rive animation has finished playing, so I can show the main content of my app?

struct MainView: View {

    var openingAnimation = RiveViewModel(fileName: "opening_animation")

    var body: some View {
        // if openingAnimation.hasFinishedPlaying() { <-- is there some method that looks like this?
            openingAnimation.view()
        // } else {
        // show main content of app
        // }

    }

}

It's a very simple Rive animation (imagine a rectangle moving from top of bottom of the artboard), no fancy state machine logic or input variables.

Tried diving into the Rive docs but couldn't find anything that seems to clearly address this - though it should be a very simple use case.

thecanteen
  • 762
  • 5
  • 13

0 Answers0