title: Why does viewWillAppear not get called when an app comes back from the background?
body: <p>I'm writing an app and I need to change the view if the user is looking at the app while talking on the phone.</p>
  
  <p>I've implemented the following method:</p>
  
  <pre><code>- (void)viewWillAppear:(BOOL)animated {
      [super viewWillAppear:animated];
      NSLog(@"viewWillAppear:");
      _sv.frame = CGRectMake(0.0, 0.0, 320.0, self.view.bounds.size.height);
  }
  </code></pre>
  
  <p>But it's not being called when the app returns to the foreground.</p>
  
  <p>I know that I can implement:</p>
  
  <pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarFrameChanged:) name:UIApplicationDidChangeStatusBarFrameNotification object:nil];
  </code></pre>
  
  <p>but I don't want to do this. I'd much rather put all my layout information in the viewWillAppear: method, and let that handle all possible scenarios.</p>
  
  <p>I've even tried to call viewWillAppear: from applicationWillEnterForeground:, but I can't seem to pinpoint which is the current view controller at that point.</p>
  
  <p>Does anybody know the proper way to deal with this? I'm sure I'm missing an obvious solution.</p>