NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills 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?


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:


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!


Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until October 1st.

Click to save your free spot now

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.