Reputation: 1113
I have a UINavigation base app in which I was supporting all orientations for some view controller but not for all using this code
@interface UINavigationController (Autorotation)
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation; @end
@implementation UINavigationController (Autorotation)
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
if ([self.visibleViewController isKindOfClass:[MWPhotoBrowser class]] || [self.visibleViewController isKindOfClass:[ZoomPictureViewController class]]) { return YES; } return (toInterfaceOrientation == UIInterfaceOrientationPortrait); } @end
It was working great but not working in IOS6. I have set all four orientations supported in my projects plist file.
Help if anyone has found some work around for.
Upvotes: 3
Views: 185
Reputation: 809
In ios 6 there are new methods for orientation use these methods in your navigation controller subclass
-(BOOL) shouldAutorotate
{
return YES;
}
-(NSUInteger) supportedInterfaceOrientations{
if ([self.visibleViewController isKindOfClass:[YourClass class]] ||[self.visibleViewController isKindOfClass:[YourClass class]]) {
return UIInterfaceOrientationMaskAll;
}
return UIInterfaceOrientationMaskPortrait;
}
Upvotes: 1
Reputation: 676
Here is the link for apple documentation Read it :) http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/BasicViewControllers/BasicViewControllers.html
Hope this will help.
Upvotes: 1