Skip to content

Instantly share code, notes, and snippets.

@mluton
Created October 17, 2012 22:11
Show Gist options
  • Select an option

  • Save mluton/3908650 to your computer and use it in GitHub Desktop.

Select an option

Save mluton/3908650 to your computer and use it in GitHub Desktop.
Detecting Device Orientation: 1
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (UIDeviceOrientationIsPortrait(toInterfaceOrientation)) {
// do portrait stuff
}
else {
// do landscape stuff
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment