fibnochi
fibnochi

Reputation: 1113

UIView Orientation in UINavigationController in IOS6

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)

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

Answers (2)

Talha
Talha

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

ask4asif
ask4asif

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

Related Questions