2

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.

nr5
  • 4,228
  • 8
  • 42
  • 82
  • Could we look at your app delegate code? You should be able to distinguish what sort of app start is taking place based on the invocation of `application: didReceiveLocalNotification:` – danh Oct 06 '17 at 14:24
  • @danh `application: didReceiveLocalNotification` is not called. My app wakes up in `didFinishLaunchingWithOptions:(NSDictionary *)launchOptions` and the `launchOptions` key has the `UIApplicationLaunchOptionsLocalNotificationKey `. Also, when my animation code executes (no matter in which state my app is) I request main queue using dispatch and perform UI operations there. So far, everything is working fine. And since, these particular animations occur via a singleton class, I did not have to request main queue everywhere in the app – nr5 Oct 08 '17 at 18:00

0 Answers0