You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2016/08/20 09:43:23 UTC
[jira] [Resolved] (CB-11614) On iOS the Objectiv-C method
'shouldAutorotateToInterfaceOrientation' is never called during/after a
device orientation
[ https://issues.apache.org/jira/browse/CB-11614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shazron Abdullah resolved CB-11614.
-----------------------------------
Resolution: Not A Problem
This is correct behaviour, that delegate method has been deprecated since iOS 6, and I don't think Apple code calls it anymore:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/#//apple_ref/occ/instm/UIViewController/shouldAutorotateToInterfaceOrientation:
The template file MainViewController.m wasn't updated to reflect the new delegate method shouldAutorotate.
You can override any of these three methods which CDVViewController implements:
https://github.com/apache/cordova-ios/blob/f75bf67438257132e739238ed579d73271b3a716/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h
I'll file a new issue to update MainViewController.m
> On iOS the Objectiv-C method 'shouldAutorotateToInterfaceOrientation' is never called during/after a device orientation
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: CB-11614
> URL: https://issues.apache.org/jira/browse/CB-11614
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS
> Affects Versions: 4.2.0
> Environment: * iMAC with OS X El Capitan Version 10.11.5
> * X-Code Version 7.3 (7D175)
> * iPhone 4S with iOS 9.3.3
> * Latest Version of Cordova 4.2.0
> Reporter: Ronny Schleicher
> Priority: Critical
>
> h3. Steps to reproduce
> h4. 1. Create a new fresh cordova app on your iMAC
> {code}
> cordova create PhoneGap_ios de.test.test Test
> cd PhoneGap_ios
> cordova platform add ios --save
> cordova plugin add cordova-plugin-device-motion
> cordova plugin add cordova-plugin-device-orientation
> cordova plugin add cordova-plugin-network-information
> cordova plugin add cordova-plugin-device
> cordova plugin add cordova-plugin-splashscreen
> cordova plugin add cordova-plugin-console
> cordova plugin add cordova-plugin-statusbar
> cordova plugin ls
> {code}
> h4. 2. Open the x-code project an enable in the project all orientations
> Targets -> Test -> General -> Deployment Info -> Device Orientation -> check all orientations
> h4. 3. Set a breakpoint in follow method
> {code:title=MainViewController.m|borderStyle=solid}
> - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
> {
> // Return YES for supported orientations
> return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
> }
> {code}
> h4. 5. Now connect your iPhone and run the Test App
> With a change in orientation of the device, the method is never called.
> Is this correct? I believe this is an error.
> The method should be invoked in any change of orientation.
> h3. Notes and a Workaround
> In an earlier version of Cordova (3.9.2???) the *shouldAutorotate* method was used at this point. This old method I have installed in my app as workaround again.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org