How to stop/handle UI Operations in iOS when app moves to background state?

Viewed 271

My app can be launched via UIApplicationLaunchOptionsLocalNotificationKey in the background. In that case the usual flow to setup initail view controller and some animations on the app's landing-page/first-page of the app take place.

My question is, Is this a good practice, If I leave these animations like this even when my app is launched via OS in background? Three things I am concerned about:

  1. Some animations are continuous, like a circular-dot(UIImage) expanding and shrinking, using CAAnimation.

  2. Some views are added and removed as subviews to the keyWindow, based on user location.

  3. When user taps the home button, do I need to stop the animations and subview additions then also?

Making the animation stop and resume via applicationDidEnterBackground and applicationWillEnterForeground seems tedious.

0 Answers
Related