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;
}
@pdimu
Copy link

pdimu commented Jul 2, 2024

ayo is this the first gist?

@pdimu
Copy link

pdimu commented Jul 4, 2024

@lansing idk I sorted them on the search or sth. I was a lil bit high and entered gist for some reason. Thanks for the even older gist 💠

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment