title: How to fix iOS 7 status bar height and width issue
body: <p>I have made a custom toast library (very simple, just a box which appears under navigation bar). Which works fine in iOS 6 which is my target group. But since iOS 7 has released it didn't display correctly.</p>
  
  <p>The way I tried to fix it was through this code:</p>
  
  <pre><code>if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7,0")){
      self.offset = [UIApplication sharedApplication].statusBarFrame.size.height + self.viewController.navigationController.navigationBar.frame.size.height;
  }
  </code></pre>
  
  <p>I made a macro which can be found on Stack overflow to detect if the iOS version is 7 and then add the status bar height and the navigation height. This works correctly in portrait mode in iOS 7, but when I switch to landscape offset becomes 512?.</p>
  
  <p>Can anybody explain way this happens and how I can fix this?</p>
  
  <hr>
  
  <p>Decided to split the code because a comment and see what is exactly causing the difference. What I did was:</p>
  
  <p>CGFloat statusBarHeight =[UIApplication sharedApplication].statusBarFrame.size.height;</p>
  
  <pre><code>CGFloat navBar = self.viewController.navigationController.navigationBar.frame.size.height;
  self.offset = statusBarHeight + navBar;
  NSLog(@"Init - statusBarHeight: %f, navBar: %f", statusBarHeight, navBar);
  </code></pre>
  
  <p>As it turns out for some reason statusbar is in portrait  20 and in landscape it is 480</p>
  
  <hr>
  
  <p>This is because height and width are turned around, answer came from comment</p>