I have a tab bar controller with four different views. Recently, I wanted to incorporate rotating for only one of my views. I read somewhere that for tab controllers, all subviews needed to return YES in the method shouldAutoRotateToInterfaceOrientation:. I have done this and everything works, however, I only want one of the views to go into landscape mode, not all. I can only seem to get it in an all-or-nothing situation, meaning its either all rotate or none.
I have a tab bar controller with four different views. Recently, I wanted to
Share
Add this to those VCs that only support portrait mode:
Add this to the VC that supports landscape too:
The above would mean you need 4 VC’s to control the tabs which isn’t what you wanted.
What you can do as well is make an extra boolean in your mainVC which is NO by default.
Then when you open that particular view that supports all orientations you just put that boolean on YES and do the following code: