title: How do I update the StatusBar Style as part of a custom transition
body: <p>I'm using the iOS 7 <code>UIviewControllerAnimatedTransitioning</code> protocol to present a modal <code>ViewController</code> with a custom animation.  The animation works correctly, however, I want the newly presented <code>ViewController</code> to have a different status bar style than the presenting VC.</p>
  
  <p>What I'm seeing is that <code>-(UIStatusBarStyle)preferredStatusBarStyle</code> gets called on the PRESENTING <code>ViewController</code> (several times in fact) and never on the newly presented <code>ViewController</code>.  If I remove the custom animation everything with the status bar works as I'd expect.</p>
  
  <p>Is there something special I need to do in my animateTransition function to update the root view controller or something?  I've tried manually setting the statusBar with <code>[UIApplication sharedApplication] setStatusBarStyle</code> but it doesn't work (I think because I'm using the ios 7 view controller based status bar styling).</p>
  
  <p>This is my code for animateTransition:</p>
  
  <pre><code>- (void)animateTransition:(id&lt;UIViewControllerContextTransitioning&gt;)transitionContext
  {
      UICollectionViewCell *activeCell;
      if ([self.collectionView.visibleCells containsObject:self.cellForActiveIdeaVC]) {
          activeCell = self.cellForActiveIdeaVC;
      }
  
      UIView *container = transitionContext.containerView;
      UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
      UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
      UIView *fromView = fromVC.view;
      UIView *toView = toVC.view;
  
      CGRect beginFrame;
      if (activeCell) {
          beginFrame = [container convertRect:activeCell.bounds fromView:activeCell];
      } else {
          beginFrame = CGRectMake(container.width / 2, container.height / 2, 0, 0);
      }
  
      CGRect endFrame = [transitionContext initialFrameForViewController:fromVC];
  
      UIView *move = nil;
      if (toVC.isBeingPresented) {
          toView.frame = endFrame;
          move = [toView snapshotViewAfterScreenUpdates:YES];
          move.frame = beginFrame;
      } else {
          if (activeCell) {
              move = [activeCell snapshotViewAfterScreenUpdates:YES];
          } else {
              move = [fromView snapshotViewAfterScreenUpdates:YES];
          }
          move.frame = fromView.frame;
          [fromView removeFromSuperview];
      }
      [container addSubview:move];
  
      [UIView animateWithDuration:.5
                            delay:0
           usingSpringWithDamping:700
            initialSpringVelocity:15
                          options:0
                       animations:^{
                           move.frame = toVC.isBeingPresented ?  endFrame : beginFrame;
                       }
                       completion:^(BOOL finished) {
                           [move removeFromSuperview];
  
                           if (toVC.isBeingPresented) {
                               toView.frame = endFrame;
                               [container addSubview:toView];
                           } else {
                               if (self.cellForActiveIdeaVC) {
                                   self.cellForActiveIdeaVC = nil;
                               }
                           }
  
                           [transitionContext completeTransition:YES];
                       }];
  }
  </code></pre>
  
  <p>Any pointers much appreciated!</p>