I have a problem with my app. I cannot lock the orientation of my app. All I need to do is to lock one view controller to landscape mode and the rest are portrait.
This is hierarchy of my app.
*Navigation Controller
*TabBarController
*ViewControllers
You only have to return
NO
fromshouldAutorotate
and the landscape orientation fromsupportedInterfaceOrientation
in the one you want to be in landscape.On the other, return
NO
too fromshouldAutorotate
method and portrait orientations mask fromsupportedInterfaceOrientation
.In all the viewControllers :
In the one you want in landscape :
In the controllers you want in portrait :
Use below 2 this methods to lock device orientation to landscape.
With NavigationController
these method are never called , if you use 'show segue(push)'.
change segue 'showDetail' instead 'show'