Я обычно включаю уведомления:
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
На своих контроллерах я поставил:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[self configureOrientation:toInterfaceOrientation];
}
- (void)configureOrientation:(UIInterfaceOrientation)orientation
{
if(UIDeviceOrientationIsValidInterfaceOrientation(orientation)){
if(UIInterfaceOrientationIsLandscape(orientation)){
[self configureLandscapelView];
}else if(UIInterfaceOrientationIsPortrait(orientation)){
[self configurePortraitlView];
}
}
}
Вы также можете получить ориентацию из самого UIViewController:
UIInterfaceOrientation orientation = [self interfaceOrientation];
Или из строки состояния:
[UIApplication sharedApplication] statusBarOrientation]