From e2983442cc81d1007b37f347b3c68c3bd022a6d0 Mon Sep 17 00:00:00 2001 From: Grant Benvenuti Date: Wed, 3 Sep 2014 11:13:54 +1000 Subject: [PATCH] Updated iOS implementation to support iOS8 beta see #19 --- src/ios/YoikScreenOrientation.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ios/YoikScreenOrientation.m b/src/ios/YoikScreenOrientation.m index 34d5fda..e6139dd 100644 --- a/src/ios/YoikScreenOrientation.m +++ b/src/ios/YoikScreenOrientation.m @@ -33,7 +33,15 @@ SOFTWARE. // ------------------ // HACK: Force rotate by changing the view hierarchy. Present modal view then dismiss it immediately. - [self.viewController presentViewController:[UIViewController new] animated:NO completion:^{ [self.viewController dismissViewControllerAnimated:NO completion:nil]; }]; + UIViewController *vc = [[UIViewController alloc] init]; + vc.view.alpha = 0; + + [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]; + }); + }]; // Assume everything went ok CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];