Skip to content

Commit d7daf99

Browse files
Merge pull request #104 from larssn/master
fix: childViewController removed correctly on hide
2 parents 0fd08fd + a0c7233 commit d7daf99

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ios/SafariViewController.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ - (UIColor *)colorFromHexString:(NSString *)hexString {
109109
}
110110

111111
- (void) hide:(CDVInvokedUrlCommand*)command {
112+
SFSafariViewController *childVc = [self.viewController.childViewControllers lastObject];
113+
if (childVc != nil) {
114+
[childVc willMoveToParentViewController:nil];
115+
[childVc.view removeFromSuperview];
116+
[childVc removeFromParentViewController];
117+
childVc = nil;
118+
}
119+
112120
if (vc != nil) {
113121
[vc dismissViewControllerAnimated:self.animated completion:nil];
114122
vc = nil;

0 commit comments

Comments
 (0)