Created
March 16, 2014 23:53
-
-
Save dpettigrew/9591636 to your computer and use it in GitHub Desktop.
Log UIInterfaceOrientation and StatusBarOrientation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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