In an app i\'m maintaining there\'s a rotate that should happen in portrait and portraitupsidedown mode. (all the rotation are enabled in the summary panel.)
My application targeted from IOS 5. I used shouldAutorotateToInterfaceOrientation method (by default) for IOS 5 device. And categories UINavigationController to handle the orientation for IOS 6.
#import "UINavigationController+Rotation_IOS6.h"
@implementation UINavigationController (Rotation_IOS6)
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
if([self.visibleViewController isMemberOfClass:NSClassFromString(@"SampleViewController")])
{
return UIInterfaceOrientationMaskLandscape | UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskPortrait;
}
return UIInterfaceOrientationPortrait;
}
@end