check if control center is used

感情迁移 提交于 2019-12-31 03:59:13

问题


My app is using internet access, and I want to know if there were used control center. If was used, I want to do some action, like start to update. I am stuck at this question. There are different guides, about "check if app is in background" or "check if wifi status changed", but no information about this. Any advices?


回答1:


You can't do it. The most you can know is that your app was deactivated and then activated again, but you have no way of finding out why. It could be because of the control center, it could be because of the notification center, it could be because a phone call came in, it could be because the user went into the app switcher and came back again... If you think you have a use case for being able obtain this particular information, submit an enhancement request to Apple.




回答2:


You can use applicationDidBecomeActive: in your app delegate. You don't know what the reason is for that part being called, but it will be called after coming back to the app from control center. From there you can refresh things.



来源:https://stackoverflow.com/questions/28034907/check-if-control-center-is-used

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