Skip to content

Instantly share code, notes, and snippets.

@sam-w
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sam-w/a4d930185d73023c84ba to your computer and use it in GitHub Desktop.
Save sam-w/a4d930185d73023c84ba to your computer and use it in GitHub Desktop.
UIApplication (OrientationCorrectedStatusBarFrame)
@implementation UIApplication (OrientationCorrectedStatusBarFrame)
//When device is in landscape orientation, we get CGRect(0, 0, 20, 1024) for statusBarFrame. This corrects the frame based on device orientation.
- (CGRect)orientationCorrectedStatusBarFrame
{
return [self.delegate.window.rootViewController.view convertRect:self.statusBarFrame fromView:self.delegate.window];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment