问题
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:
Some animations are continuous, like a
circular-dot(UIImage)
expanding and shrinking, using CAAnimation.Some views are added and removed as subviews to the
keyWindow
, based on user location.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.
来源:https://stackoverflow.com/questions/46584566/how-to-stop-handle-ui-operations-in-ios-when-app-moves-to-background-state