UIActivityViewController doesn't respect presenting view controller's supportedInterfaceOrientations

Originator:virgiliofavero
Number:rdar://22927542 Date Originated:01-Oct-2015 12:34 PM
Status:Open Resolved:
Product:iOS Product Version:8 & 9
Classification:UI/Usability Reproducible:Always
 
Summary:
I'm opening this bug as requested by the Apple Developer Technical Support. The support request number is/was: 629147647

I have an iOS project that supports portrait only, except for one view controller that can be rotated to landscape. For that reason, I have the project's info.plist configured to support both, portrait and landscape, and I then portrait only support inside each view controller.

When presenting a UIActivityViewController from a portrait only view controller, the presentation is as expected, although, as the user selects message or email for example and rotates the device to landscape, the mail/message composer will change orientation, because the project allows that. when dismissing the composer, the presenting view controller and the UIActivityViewController will be rotated to landscape and will remain that way, until the device is rotated to portrait.

The expected behaviour is that the system view controllers can freely rotate, but the apps' view controllers should have their orientation respected and upon dismissing any of the view controllers associated to the UIActivityViewController the presenting view controller is back on portrait.

I have created a sample application that I can send to be evaluated. I could find a workaround by subclassing UIActivityViewController and returning .Portrait from -supportedInterfaceOrientations.

Steps to Reproduce:
1 - Create a single view application and make sure it's marked to support Portrait, Landscape left and right.

2 - Add a UIButton to the ViewController's view. Implement supportedInterfaceOrientations in the ViewController and return .Portrait. In the buttons callback, present an instance of UIActivityViewController

3 - Launch the application and rotate the device. The view controller should not rotate at all. It should stay always on portrait.

4 - Rotate the device to landscape, press the button, and then select or mail or more, just so another view controller will be presented in landscape mode, as most of them will support landscape.

5 - Dismiss the view controller opened, and you should have the main view controller of your project, as well as the UIActivityViewController instance, rotated into landscape mode.

Expected Results:
The UIActivityViewController should inherit its presenting view controller orientation preferences

Actual Results:
A portrait only view controller can be rotated to an non-supported orientation after presenting an instance of UIActivityViewController

Version:
iOS 8 and iOS 9

Notes:


Configuration:
iPhone

Attachments:
'UIActivityViewController_orientation_issue.mp4' and 'UIActivityVCRotation.zip' were successfully uploaded.

Comments

Marked as duplicate of issue 22476762

By virgiliofavero at Oct. 11, 2015, 9:50 p.m. (reply...)

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!