title: UIStatusBar as in Facebook new iOS7 application
body: <p>I have an app with side bar menu, kinda like Facebook side bar menu. I'm using this class called <code>SWRevealViewController</code> and it's working great. Now since iOS7 has came out, I just can't figure out how to adjust my Status and Navigation Bar to be like in Facebook app.</p>
  
  <p>As you can see, in the Facebook app, when the user slides the screen and open's the menu, the status bar turn from the Navigation Bar blue color to black with Fade animation. In my app, the user slides the screen to open the menu and the status bar with the blue color (that is blue because of that view NavigationBar) won't fade away and change the color into black.</p>
  
  <p><img src="https://i.stack.imgur.com/S8EMX.gif" alt="facebook app navigation bar"></p>
  
  <p><img src="https://i.stack.imgur.com/byHb1.gif" alt="my app navigation bar"></p>
  
  <p>Also, another issue that I'm having, I just can't change the StatusBar text color to white. I've tried everything, every piece of code on the internet, read all apple's documentation, but still couldn't manage to change the color.</p>
  
  <p>I also used this code:</p>
  
  <pre><code>- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation {
      return UIStatusBarAnimationFade;
  }
  
  - (UIStatusBarStyle)preferredStatusBarStyle {
      return UIStatusBarStyleLightContent;
  }
  
  - (BOOL)prefersStatusBarHidden
  {
      return NO;
  }
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <p>========================================================================</p>
  
  <p><strong>UPDATE</strong>: The solution to this problem as in @yoeriboven answer is to put 2 views on top of the <code>SWRevealViewController</code> with black color and blue color and just animate the two, this is a great solution and it worked just great.</p>
  
  <p>So, when creating the revealController I've created 2 blank UIViews and added them, one blue and one black. One of them, the black one, I kept hidden for now.</p>
  
  <pre><code>self.revealController = [[SWRevealViewController alloc] initWithRearViewController:nil frontViewController:self.frontViewController];
  self.revealController.delegate = self;
  
  self.appDelegate.window.rootViewController = self.revealController;
  
  self.statusBarBlack = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.appDelegate.window.frame.size.width, 20)];
  [self.statusBarBlack setBackgroundColor:[UIColor blackColor]];
  
  self.statusBarBlue = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.appDelegate.window.frame.size.width, 20)];
  [self.statusBarBlue setBackgroundColor:[UIColor blueColor]];
  
  [self.appDelegate.window.rootViewController.view addSubview:self.statusBarBlack];
  [self.appDelegate.window.rootViewController.view addSubview:self.statusBarBlue];
  </code></pre>
  
  <p>Now if you are using <code>SWRevealViewController</code> you can use the next code, if not, just build it on your own, inside <code>SWRevealViewController.m</code> just <code>#import "AppDelegate.h"</code> and than replace the <code>touchesMoved</code> method with this one:</p>
  
  <pre><code>- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
  {
      [super touchesMoved:touches withEvent:event];
  
      if (self.state == UIGestureRecognizerStateFailed)
          return;
  
      //  Change color of status bar by the location of your swipe
      AppDelegate *appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
      UITouch *currentTouch = [touches anyObject];
      CGPoint currentTouchLocationOnWindow = [currentTouch locationInView:appDelegate.window];
      appDelegate.splashScreen.blueStatusBar.alpha = currentTouchLocationOnWindow.x / appDelegate.window.frame.size.width;
  
      if ( _dragging )
          return;
  
      const int kDirectionPanThreshold = 5;
  
      UITouch *touch = [touches anyObject];
      CGPoint nowPoint = [touch locationInView:self.view];
  
      CGFloat moveX = nowPoint.x - _init.x;
      CGFloat moveY = nowPoint.y - _init.y;
  
      if (abs(moveX) &gt; kDirectionPanThreshold)
      {
          if (_direction == SWDirectionPanGestureRecognizerHorizontal)
              _dragging = YES;
          else
              self.state = UIGestureRecognizerStateFailed;
      }
      else if (abs(moveY) &gt; kDirectionPanThreshold)
      {
          if (_direction == SWDirectionPanGestureRecognizerVertical)
              _dragging = YES ;
          else
              self.state = UIGestureRecognizerStateFailed;
      }
  }
  </code></pre>
  
  <p>Now go down a little bit and search for the method <code>rightRevealToggleAnimated</code> and replace her with this one:</p>
  
  <pre><code>- (void)rightRevealToggleAnimated:(BOOL)animated
  {
      FrontViewPosition toogledFrontViewPosition = FrontViewPositionLeft;
      if (_frontViewPosition &gt;= FrontViewPositionLeft) {
          toogledFrontViewPosition = FrontViewPositionLeftSide;
          [UIView animateWithDuration:0.3 animations:^{
              //  Change color of status bar
              AppDelegate *appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
              appDelegate.splashScreen.blueStatusBar.alpha = 0.0;
          }];
      } else {
          [UIView animateWithDuration:0.3 animations:^{
              //  Change color of status bar
              AppDelegate *appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
              appDelegate.splashScreen.blueStatusBar.alpha = 1.0;
          }];
      }
  
      [self setFrontViewPosition:toogledFrontViewPosition animated:animated];
  }
  </code></pre>
  
  <p>That should do the trick, enjoy!</p>