WebOrCode
WebOrCode

Reputation: 7312

supportedInterfaceOrientations not working

I have Tab Bar Controller app with three UIViewController, all done in storyboard.
Device orientation is set to all, except Upside Down.

For one UIViewController, I have following code:

- (BOOL) shouldAutorotate {
     return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationPortrait;
}

But still I can rotate.
Should not supportedInterfaceOrientations limit that ?

Upvotes: 3

Views: 1218

Answers (1)

Lawliet
Lawliet

Reputation: 3499

If you are using NavigationController then you should place your code inside the NavigationController class.

Upvotes: 2

Related Questions