Skip to content

Commit bdbb1df

Browse files
authored
fix(ios): exit event not fired on swipe down (apache#737)
1 parent d5fba78 commit bdbb1df

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/ios/CDVWKInAppBrowser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
@end
5151

52-
@interface CDVWKInAppBrowserViewController : UIViewController <CDVScreenOrientationDelegate,WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>{
52+
@interface CDVWKInAppBrowserViewController : UIViewController <CDVScreenOrientationDelegate,WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,UIAdaptivePresentationControllerDelegate>{
5353
@private
5454
CDVInAppBrowserOptions *_browserOptions;
5555
NSDictionary *_settings;

src/ios/CDVWKInAppBrowser.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ - (void)show:(CDVInvokedUrlCommand*)command withNoAnimate:(BOOL)noAnimate
290290
nav.orientationDelegate = self.inAppBrowserViewController;
291291
nav.navigationBarHidden = YES;
292292
nav.modalPresentationStyle = self.inAppBrowserViewController.modalPresentationStyle;
293+
nav.presentationController.delegate = self.inAppBrowserViewController;
293294

294295
__weak CDVWKInAppBrowser* weakSelf = self;
295296

@@ -306,7 +307,6 @@ - (void)show:(CDVInvokedUrlCommand*)command withNoAnimate:(BOOL)noAnimate
306307
strongSelf->tmpWindow = [[UIWindow alloc] initWithFrame:frame];
307308
}
308309
UIViewController *tmpController = [[UIViewController alloc] init];
309-
310310
[strongSelf->tmpWindow setRootViewController:tmpController];
311311
[strongSelf->tmpWindow setWindowLevel:UIWindowLevelNormal];
312312

@@ -1257,5 +1257,10 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIVi
12571257
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
12581258
}
12591259

1260+
#pragma mark UIAdaptivePresentationControllerDelegate
1261+
1262+
- (void)presentationControllerWillDismiss:(UIPresentationController *)presentationController {
1263+
isExiting = TRUE;
1264+
}
12601265

12611266
@end //CDVWKInAppBrowserViewController

0 commit comments

Comments
 (0)