TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Circular Animation not showing when app comes back to the foreground.

Forums > iOS

I'm building a timer app with UIKit that has a circular animation. I'm using CABasicAnimation for the circular animation. Presently, when the app goes to the background, the timer and animation are supposed to pause. The timer pauses alright, and when the app is brought back to the foreground, I can tap the resume button to continue the timer countdown. The challenge I'm having is that the circular animation does not reappear when the app comes back to the foreground. Please does anyone have any ideas how I can make the animation reappear when the app comes back to the foreground, so when I press the resume button, both the animation and timer continue?

3      

Hello! I finally found a solution to the challenge above. Just in case anyone has a similar issue in the future, this stackoverflow thread has the solution: https://stackoverflow.com/questions/7568567/restoring-animation-where-it-left-off-when-app-resumes-from-background

3      

Excellent. Thanks for posting a solution.

It might help others if you explained the general problem, then the coding approach that solved the issue.

Please be sure to mark your answer as SOLVED!

3      

Hacking with Swift is sponsored by String Catalog.

SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!

Localize My App

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.