I have read countless answers and tried sooo many different things but I still cannot resolve my problem.
I'll explain it in a simple manner, first by describing my story board layout.
My storyboard structure is as follows
- UITabBarController
- UINavigationController 1
- UIViewContoller 1
- UIViewContoller 2
- UIViewContoller 3
- UINavigationController 2
- UIViewContoller 4
- UIViewContoller 5
- UINavigationController 1
The above structure is almost identical to what I currently have.
Now, this is what I would like to do; I would like to lock ALL UIViewControllers (including UITableViewControllers) so that they CANNOT rotate to landscape, except for UIViewController 3 and UIViewController 5 (Look at my structure above to see which ones they are). These two view controllers are able to be viewed in both landscape and portrait, however if the user clicks 'Back' on the navigation bar whilst they are in landscape view, the view controller will automatically rotate back to portrait.
How am I able to do this?
Additional Info:
Assume I am starting from a fresh slate and that I haven't already written code to try and solve the problem. Also assume that I have NOT made a class for each view controller. Thanks.