Merge pull request #25 from fortunes-technology/ios-landscape-issue

CB-13193: (ios) Fixed Lock iOS Landscape Orientation turn up-sidedown
This commit is contained in:
jcesarmobile 2018-07-01 14:37:52 +02:00 committed by GitHub
commit 26eb47eabc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,10 +42,10 @@
[result addObject:[NSNumber numberWithInt:UIInterfaceOrientationPortraitUpsideDown]];
}
if(orientationMask & 4) {
[result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft]];
[result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight]];
}
if(orientationMask & 8) {
[result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight]];
[result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft]];
}
SEL selector = NSSelectorFromString(@"setSupportedOrientations:");
@ -61,11 +61,12 @@
if (!_isLocked) {
_lastOrientation = [UIApplication sharedApplication].statusBarOrientation;
}
if(orientationMask == 8 || orientationMask == 12) {
value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
} else if (orientationMask == 4){
UIInterfaceOrientation deviceOrientation = [UIApplication sharedApplication].statusBarOrientation;
if(orientationMask == 8 || (orientationMask == 12 && !UIInterfaceOrientationIsLandscape(deviceOrientation))) {
value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
} else if (orientationMask == 1 || orientationMask == 3) {
} else if (orientationMask == 4){
value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
} else if (orientationMask == 1 || (orientationMask == 3 && !UIInterfaceOrientationIsPortrait(deviceOrientation))) {
value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
} else if (orientationMask == 2) {
value = [NSNumber numberWithInt:UIInterfaceOrientationPortraitUpsideDown];