GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

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 try! Swift Tokyo.

SPONSORED Ready to dive into the world of Swift? try! Swift Tokyo is the premier iOS developer conference will be happened in April 9th-11th, where you can learn from industry experts, connect with fellow developers, and explore the latest in Swift and iOS development. Don’t miss out on this opportunity to level up your skills and be part of the Swift community!

Get your ticket here

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.