IOS 8 detecting device orientation on application launch
The [[UIDevice currentDevice] orientation] method does not return the correct value when the application starts. Is this an API beta bug or is there a new method for detecting orientation in iOS 8?
This is the exact code used when starting the application.
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];
if (deviceOrientation == UIDeviceOrientationPortrait){
}
else if (deviceOrientation == UIDeviceOrientationLandscapeLeft){
[self orientationLandscapeLeftAdjust];
}
else if (deviceOrientation == UIDeviceOrientationLandscapeRight){
[self orientationLandscapeRightAdjust];
}
else if (deviceOrientation == UIDeviceOrientationPortraitUpsideDown){
[self orientationPortraitUpSideDownAdjust];
}
+3
source to share
1 answer
It turns out to be a bug related to the No SIM card message that appears every time the app is launched in the beta version of iOS 8. This causes the app to launch its default orientation in it. I read that this bug was addressed in iOS 8 beta 6 which was circulated to carriers and other testing partners.
+1
source to share