mirror of
https://github.com/apache/cordova-plugin-screen-orientation.git
synced 2025-05-05 01:32:59 +08:00
Merge pull request #54 from orlando-antonino/master
background thread for ios
This commit is contained in:
commit
c7e3cf423f
@ -27,6 +27,8 @@ SOFTWARE.
|
|||||||
|
|
||||||
-(void)screenOrientation:(CDVInvokedUrlCommand *)command
|
-(void)screenOrientation:(CDVInvokedUrlCommand *)command
|
||||||
{
|
{
|
||||||
|
[self.commandDelegate runInBackground:^{
|
||||||
|
|
||||||
NSArray* arguments = command.arguments;
|
NSArray* arguments = command.arguments;
|
||||||
NSString* orientationIn = [arguments objectAtIndex:1];
|
NSString* orientationIn = [arguments objectAtIndex:1];
|
||||||
|
|
||||||
@ -77,12 +79,16 @@ SOFTWARE.
|
|||||||
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[self.viewController presentViewController:vc animated:NO completion:^{
|
[self.viewController presentViewController:vc animated:NO completion:^{
|
||||||
// added to support iOS8 beta 5, @see issue #19
|
// added to support iOS8 beta 5, @see issue #19
|
||||||
dispatch_after(0, dispatch_get_main_queue(), ^{
|
dispatch_after(0, dispatch_get_main_queue(), ^{
|
||||||
[self.viewController dismissViewControllerAnimated:NO completion:nil];
|
[self.viewController dismissViewControllerAnimated:NO completion:nil];
|
||||||
});
|
});
|
||||||
}];
|
}];
|
||||||
|
});
|
||||||
|
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user