LottieView.animationDidFinish not called correctly when background behavior is set to continue playing #2318
arnopoulos
started this conversation in
General
Replies: 1 comment 1 reply
-
Unfortunately I don't think it's possible for us to solve this for various reasons:
I'd suggest using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone, I am currently experiencing an issue with the following code:
When backgrounding the app the animation continues to run however, the
animationDidFinish
handler is called as soon as the application is backgrounded rather than when the Lottie has completed running. In addition, when the Lottie has completed running it will not call theanimationDidFinish
handler, regardless of if the Lottie completes in the background/foreground.I believe that this has something to do with how Core Animation treats
CAAnimationDelegate.animationDidStop(_:finished:)
and more specifically the problem seems to be inLottie.AnimationCompletionDelegate
.Which Version of Lottie are you using?
Lottie 4.4.0
Expected Behavior
When the background behavior is set to
LottieBackgroundBehavior.LottieBackgroundBehavior
, there are two things that should occur:animationDidFinish
handler should not be calledanimationDidFinish
handler should be called.Actual Behavior
When the background behavior is set to
LottieBackgroundBehavior.LottieBackgroundBehavior
, there are two things that occur:animationDidFinish
handler is called as if the Lottie was cancelledanimationDidFinish
handler should is not called.Animation JSON
I don't have one that I can provide but I don't believe that matters here.
Beta Was this translation helpful? Give feedback.
All reactions