Why does my UIApplicationDelegate receive applicationDidBecomeActive when pulling down notification center?

后端 未结 1 1541
情话喂你
情话喂你 2020-12-30 06:13

I\'ve built a bare application with no functionality in XCode, and put logging statements in the applicationDidBecomeActive and applicationWillResignActive methods.

相关标签:
1条回答
  • 2020-12-30 06:41

    There are actually two issues, the unexpected call to applicationDidBecomeActive: and the duplicated call to applicationWillResignActive:.

    "Pull down" to show a notification center used to work properly on iOS 9. Only applicationWillResignActive: used to be called by the system, just verified it with iOS 9 Simulator.

    On iOS 11.2.6, the applicationDidBecomeActive: gets called as you described which seems like an Apple bug. In this particular case, the system behavior conflicts with the documentation. Here is another example where the documentation deviates from the behavior you observed https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StrategiesforHandlingAppStateTransitions/StrategiesforHandlingAppStateTransitions.html#//apple_ref/doc/uid/TP40007072-CH8-SW10

    When your app is moved back to the active state, its applicationDidBecomeActive: method should reverse any of the steps taken in the applicationWillResignActive: method.

    0 讨论(0)
提交回复
热议问题