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 @@ static id styling;
 }
 
 - (UIViewController*) getTopMostViewController {
-  UIViewController *presentingViewController = [[[UIApplication sharedApplication] delegate] window].rootViewController;
+  UIViewController *presentingViewController = [[UIApplication sharedApplication] keyWindow].rootViewController;
   while (presentingViewController.presentedViewController != nil) {
     presentingViewController = presentingViewController.presentedViewController;
   }