1

Control centre calls AppDelegate

- (void)applicationWillResignActive:(UIApplication *)application {    
}

- (void)applicationDidBecomeActive:(UIApplication *)application {

}

these two method, But which UIViewController method is called

Darshit Shah
  • 2,366
  • 26
  • 33
Pias
  • 218
  • 1
  • 2
  • 13
  • This is related to the Application delegation not with the View controllers. – Ashwin Kanjariya Apr 11 '17 at 06:48
  • Do you want to perform any action in any particular view controller when the app goes background or become active? If so, you can add notification for these events in the desired view controller ad handle accordingly. – QUserS Apr 11 '17 at 06:52
  • Please refer to this link: http://stackoverflow.com/questions/10359186/how-to-tell-the-active-view-controller-when-applicationdidbecomeactive-is-called May be helpful for you. – Aashish1aug Apr 11 '17 at 07:06

1 Answers1

2

When any interruption will come in application it will call

(void)applicationWillResignActive:(UIApplication *)application

method. And when user come back to app or interruption removed then it will call

(void)applicationDidBecomeActive:(UIApplication *)application

For example, if any incoming call come or user open notifications from sliding down or control centre.

Hardik Halani
  • 290
  • 2
  • 12