Skip to content

Instantly share code, notes, and snippets.

@dpettigrew
Created March 16, 2014 23:53
Show Gist options
  • Save dpettigrew/9591636 to your computer and use it in GitHub Desktop.
Save dpettigrew/9591636 to your computer and use it in GitHub Desktop.
Log UIInterfaceOrientation and StatusBarOrientation
- (void)logInterfaceOrientation {
if (self.interfaceOrientation == UIInterfaceOrientationPortrait) {
NSLog(@"UIInterfaceOrientationPortrait");
}
if (self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"UIInterfaceOrientationPortraitUpsideDown");
}
if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
NSLog(@"UIInterfaceOrientationLandscapeLeft");
}
if (self.interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
NSLog(@"UIInterfaceOrientationLandscapeRight");
}
}
- (void)logStatusBarOrientation {
UIInterfaceOrientation interfaceOrientation = [UIApplication sharedApplication].statusBarOrientation;
if (interfaceOrientation == UIInterfaceOrientationPortrait) {
NSLog(@"UIInterfaceOrientationPortrait");
}
if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"UIInterfaceOrientationPortraitUpsideDown");
}
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
NSLog(@"UIInterfaceOrientationLandscapeLeft");
}
if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
NSLog(@"UIInterfaceOrientationLandscapeRight");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment