diff --git a/src/ios/Toast+UIView.m b/src/ios/Toast+UIView.m index 75e8872..aaf1f92 100644 --- a/src/ios/Toast+UIView.m +++ b/src/ios/Toast+UIView.m @@ -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; }