6A280e / 12A4345d: Presenting view controllers rotate to unsupported orientations

Originator:matt
Number:rdar://18176955 Date Originated:8.29.2014
Status:Open Resolved:
Product:iOS SDK Product Version:6A280e / 12A4345d
Classification:Serious Bug Reproducible:Always
 
The attached project has a parent view controller that supports portrait orientation only. It presents a modal view controller that supports all orientations. When rotating the modal view to landscape, then dismissing it, the presenting view, which does not support landscape orientation, is forced into landscape anyway.

This only happens when built with the iOS 8 SDK and running on iOS 8. This does not happen when run on iOS 7, or on iOS 8 when built with a pre-8 SDK.

This is certainly a regression from iOS 7, and possibly from earlier betas of iOS 8, but I don't have the capability of confirming that.

The primary and very common use case here is a portrait-only design with the exception of video playback, which permits landscape.

Please advise a workaround if this problem cannot or will not be fixed. The only ones I can think of are:

1) Force portrait-only video playback (not at all desirable)
2) Keep building with the iOS 7 SDK in the near-term (not at all desirable)

Steps to Reproduce:
With Xcode 6:

1. Run the attached project. Note the root VC does not rotate
2. Hit the "Show Basic Rotatable View" button from portrait orientation
3. Rotate to landscape after the modal view shows
4. Hit the "Back" button

Expected Results:
Initial view remains in portrait, as on iOS 7.

Actual Results:
Initial view does not remain in portrait.

Version:
Xcode 6A280e / iOS 12A4345d

Comments

Since it's now the UIWindow that rotates, rather than the view controller, this doesn't seem too unreasonable, in that the UIWindow gets forced into the new orientation by the presented controller.

The fix is to change

-(BOOL)shouldAutotate { return NO; }

to

-(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; }

Project download

https://www.dropbox.com/s/ms4bcdhrt0gdf80/OrientationProblems.zip?dl=0


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!