title: How can I use applicationDidBecomeActive in UIViewController?
body: <p>I want to reload data in UIViewController when application become active or become foreground.</p>
  
  <p>I know applicationDidBecomeActive is called in AppDelegate class.<br>
  But I have to have a global variable for the UIViewController to reload its data in AppDelegate class like this code:</p>
  
  <pre><code>in AppDelegate.m
  
  // global variable
  UIViewController *viewController1;
  UIViewController *viewController2;
  
  -(void)applicationDidBecomeActive:(UIApplication *)application
  {
      [viewController1 reloadData];
      [viewController2 reloadData];
  }
  </code></pre>
  
  <p>But it is inconvenient especially when I have a lot of UIViewControllers.</p>
  
  <p>Can I use applicationDidBecomeActive in UIViewController instead of in AppDelegate class?<br>
  Or are there better ways than having global variable for UIViewController?</p>
  
  <p>I also need to use the following method from UIViewControllers:</p>
  
  <pre><code>-(void)applicationWillResignActive:(UIApplication *)application
  -(void)applicationDidEnterBackground:(UIApplication *)application
  -(void)applicationWillEnterForeground:(UIApplication *)application
  </code></pre>