I got this code that if the device is in landscape left/right or upside down it rotates and shows another view controller. but if it´s in the orientation face up or face down, then how can I tell if it´s in landscape mode or portrait? cause I only want to rotate if it´s face up or down and in landscape mode
- (void)viewDidAppear:(BOOL)animated
{
UIDeviceOrientation orientation = [[UIDevice currentDevice]orientation];
NSLog(@"orientation %d", orientation);
if ((orientation == 2) || (orientation == 3) || (orientation == 4))
{
[self performSegueWithIdentifier:@"DisplayLandscapeView" sender:self];
isShowingLandscapeView = YES;
}
}