问题
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