First of all, this isn't a duplicate. I've looked at all of the questions related to this on SO and none of them work for me. Hopefully it's just because I'm new to iOS development but I suspect this isn't possible in my case. I've attached a picture with the view controller circled that I want to disable rotation for.
I've already tried: Subclassing the view controller that I want to disable rotation for and using the shouldAutoRotate
method by setting it to NO. Apparently this doesn't work because it's the navigation controller that dictates whether its view controllers can rotate. So, I subclassed UINavigationController
and used this class in storyboard instead of the default navigation controller. In this class I've set shouldAutoRotate
to NO. It still doesn't work. Don't really know what I'm doing wrong.
When I extend the root view controller with my view controller class with shouldAutoRotate
set to NO, it disables rotation...for the whole app. This is not what I want. I only want the rotation to be disabled for the view controller circled in the picture.
Thanks in advance!