@@ -80,6 +80,11 @@ - (void)close:(CDVInvokedUrlCommand*)command
80
80
NSLog (@" IAB.close() called but it was already closed." );
81
81
return ;
82
82
}
83
+
84
+ // Set tmpWindow to hidden to make main webview responsive to touch again
85
+ // https://stackoverflow.com/questions/4544489/how-to-remove-a-uiwindow
86
+ self->tmpWindow .hidden = YES ;
87
+
83
88
// Things are cleaned up in browserExit.
84
89
[self .inAppBrowserViewController close ];
85
90
}
@@ -314,17 +319,18 @@ - (void)show:(CDVInvokedUrlCommand*)command withNoAnimate:(BOOL)noAnimate
314
319
dispatch_async (dispatch_get_main_queue (), ^{
315
320
if (weakSelf.inAppBrowserViewController != nil ) {
316
321
float osVersion = [[[UIDevice currentDevice ] systemVersion ] floatValue ];
317
- if (!self->tmpWindow ) {
322
+ __strong __typeof (weakSelf) strongSelf = weakSelf;
323
+ if (!strongSelf->tmpWindow ) {
318
324
CGRect frame = [[UIScreen mainScreen ] bounds ];
319
325
if (initHidden && osVersion < 11 ){
320
326
frame.origin .x = -10000 ;
321
327
}
322
- self ->tmpWindow = [[UIWindow alloc ] initWithFrame: frame];
328
+ strongSelf ->tmpWindow = [[UIWindow alloc ] initWithFrame: frame];
323
329
}
324
330
UIViewController *tmpController = [[UIViewController alloc ] init ];
325
331
326
- [self ->tmpWindow setRootViewController: tmpController];
327
- [self ->tmpWindow setWindowLevel: UIWindowLevelNormal];
332
+ [strongSelf ->tmpWindow setRootViewController: tmpController];
333
+ [strongSelf ->tmpWindow setWindowLevel: UIWindowLevelNormal];
328
334
329
335
if (!initHidden || osVersion < 11 ){
330
336
[self ->tmpWindow makeKeyAndVisible ];
0 commit comments