Friday, July 25, 2014

Check device orientation

UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;

 if ((orientation == UIInterfaceOrientationLandscapeLeft) || (orientation == UIInterfaceOrientationLandscapeRight)) {
     //Landscape mode
}
 else if ((orientation == UIInterfaceOrientationPortrait) || (orientation == UIInterfaceOrientationPortraitUpsideDown)) {
     //Portrait mode
}

No comments:

Post a Comment