Skip to content

Commit

Permalink
fix: childViewController removed correctly on hide
Browse files Browse the repository at this point in the history
When 'hidden' is specified for a tab, it gets added as a childView to the viewController, but did not get removed again on hide().
  • Loading branch information
larssn committed Mar 6, 2018
1 parent 0fd08fd commit a0c7233
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ios/SafariViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ - (UIColor *)colorFromHexString:(NSString *)hexString {
}

- (void) hide:(CDVInvokedUrlCommand*)command {
SFSafariViewController *childVc = [self.viewController.childViewControllers lastObject];
if (childVc != nil) {
[childVc willMoveToParentViewController:nil];
[childVc.view removeFromSuperview];
[childVc removeFromParentViewController];
childVc = nil;
}

if (vc != nil) {
[vc dismissViewControllerAnimated:self.animated completion:nil];
vc = nil;
Expand Down

0 comments on commit a0c7233

Please sign in to comment.