Couldn't find onAnimationRepeat listener? #1851
-
Is there some kind of When animation is in a loop mode, every moment it starts over we have It would be nice to have one! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We don't currently provide callbacks for this type of thing. One key obstacle is that this wouldn't work with the new default Core Animation rendering engine, where Lottie itself isn't running code every frame so wouldn't know when to call the closure. One way to accomplish this functionality in user code could be: func playAnimationOnce() {
animationView.play(loopMode: .playOnce, completion: {
// perform code now that the animation has finished its loop
self.playAnimationOnce() // continue looping after the animation completes
})
} |
Beta Was this translation helpful? Give feedback.
We don't currently provide callbacks for this type of thing. One key obstacle is that this wouldn't work with the new default Core Animation rendering engine, where Lottie itself isn't running code every frame so wouldn't know when to call the closure.
One way to accomplish this functionality in user code could be: