diff --git a/src/ios/CDVWKInAppBrowser.h b/src/ios/CDVWKInAppBrowser.h index e339be1..2f650b8 100644 --- a/src/ios/CDVWKInAppBrowser.h +++ b/src/ios/CDVWKInAppBrowser.h @@ -49,7 +49,7 @@ @end -@interface CDVWKInAppBrowserViewController : UIViewController { +@interface CDVWKInAppBrowserViewController : UIViewController { @private CDVInAppBrowserOptions *_browserOptions; NSDictionary *_settings; diff --git a/src/ios/CDVWKInAppBrowser.m b/src/ios/CDVWKInAppBrowser.m index 1ec2065..64fae78 100644 --- a/src/ios/CDVWKInAppBrowser.m +++ b/src/ios/CDVWKInAppBrowser.m @@ -290,6 +290,7 @@ static CDVWKInAppBrowser* instance = nil; nav.orientationDelegate = self.inAppBrowserViewController; nav.navigationBarHidden = YES; nav.modalPresentationStyle = self.inAppBrowserViewController.modalPresentationStyle; + nav.presentationController.delegate = self.inAppBrowserViewController; __weak CDVWKInAppBrowser* weakSelf = self; @@ -306,7 +307,6 @@ static CDVWKInAppBrowser* instance = nil; strongSelf->tmpWindow = [[UIWindow alloc] initWithFrame:frame]; } UIViewController *tmpController = [[UIViewController alloc] init]; - [strongSelf->tmpWindow setRootViewController:tmpController]; [strongSelf->tmpWindow setWindowLevel:UIWindowLevelNormal]; @@ -1257,5 +1257,10 @@ BOOL isExiting = FALSE; [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; } +#pragma mark UIAdaptivePresentationControllerDelegate + +- (void)presentationControllerWillDismiss:(UIPresentationController *)presentationController { + isExiting = TRUE; +} @end //CDVWKInAppBrowserViewController