UINavigationController does not delegate auto-rotation/orientation calls to the top view controller

Originator:wangjammer5
Number:rdar://14080208 Date Originated:06-Jun-2013 01:11 PM
Status:Open Resolved:
Product:iPhone SDK Product Version:6.1
Classification:Other Bug Reproducible:Always
 
Summary:

The documentation states that the full screen view controller acts as the root view controller in iOS 6 orientation handling.

However when a view controller is presented by a UINavigationController, not all of the methods are handled in this way.

Specifically:

- (NSUInteger)supportedInterfaceOrientations

*is* called on  the top / visible view controller, but the result is ignored. i.e. trying to restrict it to Portrait has no effect, and the view is still rotated to landscape.

The method:

- (BOOL)shouldAutorotate

is *not* called on the top/visible view controller.

Steps to Reproduce:

1. Create a UINavigationController
2. Add another view controller to it
3. In that view controller implement the supportedInterfaceOrientations and shouldAutorotate methods
4. Add breakpoints in both methods
5. Run app in portrait
6. Rotate to landscape

Expected Results:

That supportedInterfaceOrientations is called and shouldAutorotate is called.

Actual Results:

The method supportedInterfaceOrientations is called but the result not used (i.e. restricting to Portrait does nothing) and shouldAutorotate is not called.

Regression:

Don't know

Notes:

I may be wrong, but it seems fair to assume this behaviour of UINavigationController. Not having this logic in place means that you have to subclass UINavigationController to delegate these methods to the top/visibile UI controller

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!