I have all the app in portrait mode, but I have one of the viewcontroller in landscape mode to be a gallery of images.
On the tab Project Summary enable LandscapeLeft mode, so I have to disable the rotation this way in the rest of the Viewcontroller, except in the VC of the image gallery.
I want to keep the rotation in Portrait mode, to do this and to block all the VC portrait, I used the following code
-(BOOL)shouldAutorotate{
return YES;
}
-(NSInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
}
return UIInterfaceOrientationPortrait;
}
This, keep me the landscape mode in the previous VC , when it should be rotated to Portrait.
Any idea do?
For Portrait Mode VC,
For Landscape mode VC,
If you are using navigationController,
Create a category like this,