Skip to content

Instantly share code, notes, and snippets.

@lansing
Created July 17, 2008 20:38
Show Gist options
  • Save lansing/16 to your computer and use it in GitHub Desktop.
Save lansing/16 to your computer and use it in GitHub Desktop.
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
if (orientation == UIInterfaceOrientationLandscapeRight || orientation == UIInterfaceOrientationLandscapeLeft ) {
NSLog(@"Landscape");
self.pageWidth = size.width;
self.pageHeight = size.height;
}
else {
NSLog(@"Portrait");
self.pageWidth = size.height;
self.pageHeight = size.width;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment