Skip to content

Commit

Permalink
get real top most view controller
Browse files Browse the repository at this point in the history
  • Loading branch information
yjajkiew committed Mar 15, 2018
1 parent 4324168 commit a429424
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ios/Toast+UIView.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ - (void)showToast:(UIView *)toast duration:(NSTimeInterval)duration position:(id
}

- (UIViewController*) getTopMostViewController {
UIViewController *presentingViewController = [[[UIApplication sharedApplication] delegate] window].rootViewController;
UIViewController *presentingViewController = [[UIApplication sharedApplication] keyWindow].rootViewController;
while (presentingViewController.presentedViewController != nil) {
presentingViewController = presentingViewController.presentedViewController;
}
Expand Down

0 comments on commit a429424

Please sign in to comment.