Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Not A Problem
-
4.2.0
-
None
-
None
-
- 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
Description
Steps to reproduce
1. Create a new fresh cordova app on your iMAC
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
2. Open the x-code project an enable in the project all orientations
Targets -> Test -> General -> Deployment Info -> Device Orientation -> check all orientations
3. Set a breakpoint in follow method
MainViewController.m
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; }
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.
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.
Attachments
Issue Links
- is related to
-
CB-11729 template file MainViewController.m has deprecated override shouldAutorotateToInterfaceOrientation
- Closed