disable upside down orientation

This commit is contained in:
Benjamin Reis 2018-05-31 15:27:45 +02:00
parent 18c1b67714
commit 23c18dc5e0
3 changed files with 7 additions and 3 deletions

View file

@ -830,7 +830,7 @@ didInvalidatePushTokenForType:(NSString *)type {
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
return UIInterfaceOrientationMaskPortrait;
}
else return UIInterfaceOrientationMaskAll;
else return UIInterfaceOrientationMaskAllButUpsideDown;
}
@end

View file

@ -256,6 +256,9 @@ static RootViewManager *rootViewManagerInstance = nil;
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration {
if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
return;
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
[mainViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
[self orientationUpdate:toInterfaceOrientation];
@ -263,6 +266,9 @@ static RootViewManager *rootViewManagerInstance = nil;
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration {
if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
return;
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
[mainViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
}

View file

@ -103,13 +103,11 @@
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>