applicationWillResignActive called without reason on iOS 10 ( swift 3 )

岁酱吖の 提交于 2019-12-05 06:04:49
abagmut

The problem is, it calls second time after dismissing system services alert (location, push notifications, photos)

So the only way to handle it is to use variable in AppDelegate which increments each time some system alert shows and decrements in applicationDidBecomeActive, so you call your code only if value of this variable is 1.

Another interesting thing is that applicationDidEnterBackground doesn't call when system alert shows, thus we can use this info to decide whether we should call our code in applicationDidBecomeActive or not (but still, it can be less reliable solution)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!