Closed Duraiamuthan closed 6 years ago
Tried pausing and resuming the layer as per apple documentation but still not working.
Please find the sample code here
That's tricky, maybe as a workaround you can, upon going to background, save the time and when the user comes back again calculate the difference in time and set the animation again. that should work for now.
Yes that's right.But pausing and resuming the animation at layer level would be a best option rather than starting the animation on our own again.IfpauseLayer is called on applicationWillResignActive it stops the animation and doesn't let the animation go to value 55 when the app is brought to foreground but now resumeLayer is not working as expected.so now the scenario is that the animation is frozen with the value it had when the app was going background.If I could find a way I will keep it posted here.
Let's say my animation time is 30 seconds and I will have progress bar reached to 55 when 30 seconds are over.but If I push the app to background and bring it to foreground then the progress bar has reached to 55 even though 30 seconds are not over yet.