I only want to support different Orientations on one View in my UINavigationController Stack. How can I do this?
It also has to work in iOS5.
I only want to support different Orientations on one View in my UINavigationController Stack. How can I do this?
It also has to work in iOS5.
The solution does not work on iOS 6 (ok on iOS 5) when:
vc A
is supporting only portrait orientationvc B
is supporting all orientationsvc B
fromvc A
, rotatevc B
(e.g. in landscape) and pop back tovc A
.vc A
orientation stays in landscape mode...I recommend you to NOT create a category on UINavigationController to override those methods. Categories are not aimed to do that, and there is no warranty that your code is going to be loaded instead of Apple's one (even if actually that works). I advise you to create a subclass of UINavigationController, and override those methods in it.
I've had a lot of trouble with how iOS6 handles Orientation, hopefully this is what you're looking for.
Create a category of UINavigationController and call it "UINavigationController+autoRotate".
Put this in your UINavigationController+autoRotate.h:
Put this in UINavigationController+autoRotate.m:
For Views that you DO NOT want to rotate, add:
And for Views you DO want to rotate:
In your App's delegate, add: