I have an iOS application with storyboard. I want my last viewcontroller to stay always in portrait mode. I've been reading and I found that since
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
is deprecated I should use other methods like
-(BOOL)shouldAutorotate
-(NSInteger)supportedInterfaceOrientations
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
but i have tried so many combinations of this methods and I have not been able to do it. So please can someone tell me the correct way?
In AppDelegate:
In Your ViewController:
Since your UIViewController is embedded in a UINavigationController it'll never get called unless you forward on the calls yourself. (A bit of a flaw in UINavigationController in my opinion)
Subclass UINavigationController like this:
If you have UIViewControllers within other UIViewControllers (ie a UINavigationController or a UITabBarController), you will need to proxy those messages to the child object you're implementing this behavior for.
Have you set a breakpoint in your implementations to be sure your view controller is being queried?