Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14499] iOS: Can not control orientation of UIActivity (modal window) when building a module

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2013-08-07T22:15:10.000+0000
Affected Version/sRelease 3.0.0, Release 3.1.0, Release 3.1.1
Fix Version/s2013 Sprint 16, 2013 Sprint 16 Core
ComponentsiOS
Labelsn/a
ReporterBetty Tran
AssigneeBlain Hamon
Created2013-07-09T14:42:15.000+0000
Updated2017-03-22T20:54:27.000+0000

Description

Description

When building a custom iOS module and using UIActivity (modal window), the UIActivityController keeps rotating, even the app orientation is locked to a particular orientation, e.g Portrait. Attached is a sample project containing the module which runs the module's example app.js The module source can be found here: https://github.com/viezel/TiSocial.Framework

Steps to reproduce

1. Run the example app 2. If you rotate the screen it should remain in portrait 3. click on the button "Activity View" 4. Try to rotate the screen. Despite the locked portrait orientation the modal window causes the screen to rotate.

Attachments

FileDateSize
rotationtest.zip2013-07-09T14:42:15.000+00002406150

Comments

  1. Blain Hamon 2013-07-31

    While working on this, I noticed that - (UIViewController *)performWithActivityItems:(NSArray *)activityItems is missing a return statement. This should be fixed in the module.
  2. Blain Hamon 2013-07-31

    Okay, so here's the sticky wicket: During device rotation, Titanium runtime consults the topmost view controller for the preferred orientation. This makes sense, as a modal can override the hidden view's orientation. As such, I'm tempted to mark this invalid, because the UI Activity's view controller is explicitly allowing the rotation by returning 26 for -[UIViewController supportedInterfaceOrientations]. So one could claim that it's the module developer's responsibility, as it's their view controller. And were the 'SLTwitterComposeViewController' subclassable or public, that's what I would suggest, but it isn't, sadly. One possible workaround would be to make a view controller that wraps and provides the right interfaceOrientation value, but that also gets difficult. However, it is one option the module developer may want to look into. So what to do? Overriding native view controller preferences is a risky proposition, one we explicitly avoid because of past issues. This especially gets hairy with parity and the like, because this WOULD be a new feature. But a native experience would allow one to do such. I hate to say it, but maybe this is something that needs punting until 3.2.0, when orientation support is limited to iOS 6+ and much of the edge cases that this would run up against are reduced.
  3. Blain Hamon 2013-07-31

    For now, advising module developer wrap their view controller in view controller which they can control orientation. Will advise to mark this ticket as invalid (since this is expected behavior) and propose a new feature for 3.2.0 as part of the orientation issues.
  4. Blain Hamon 2013-08-07

  5. Mads Moller 2013-08-16

    Blain, Thanks for the description. Make sense its invalid (even though its a bug). Ill wait for 3.2.0 to update my module
  6. Lee Morris 2017-03-22

    Closing ticket as invalid with reference to the above comments.

JSON Source