mirror of
https://github.com/apache/cordova-plugin-screen-orientation.git
synced 2025-05-05 01:32:59 +08:00
background thread for ios
This commit is contained in:
parent
4c86a0d8c6
commit
f3d451c72c
@ -27,6 +27,8 @@ SOFTWARE.
|
||||
|
||||
-(void)screenOrientation:(CDVInvokedUrlCommand *)command
|
||||
{
|
||||
[self.commandDelegate runInBackground:^{
|
||||
|
||||
NSArray* arguments = command.arguments;
|
||||
NSString* orientationIn = [arguments objectAtIndex:1];
|
||||
|
||||
@ -72,17 +74,21 @@ SOFTWARE.
|
||||
// vc.view.alpha = 0.0;
|
||||
vc.view.opaque = YES;
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
// This stops us getting the black application background flash, iOS8
|
||||
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.viewController presentViewController:vc animated:NO completion:^{
|
||||
// added to support iOS8 beta 5, @see issue #19
|
||||
dispatch_after(0, dispatch_get_main_queue(), ^{
|
||||
[self.viewController dismissViewControllerAnimated:NO completion:nil];
|
||||
});
|
||||
}];
|
||||
});
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
x
Reference in New Issue
Block a user