                 }
             }
             
-            for subView in window.subviews {
-                if let responder = subView.next {
-                    if responder.isKind(of: UIViewController.self) {
-                        return topMostViewController(responder as? UIViewController)
-                    }
-                    
+            return iterateSubViewsForViewController(window)
+        }
+        
+        return nil
+    }
+
+    private static func iterateSubViewsForViewController(_ parentView: UIView) -> UIViewController? {
+        for subView in parentView.subviews {
+            if let responder = subView.next {
+                if responder.isKind(of: UIViewController.self) {
+                    return topMostViewController(responder as? UIViewController)
                 }
             }
-        }
-        
+
+            if let found = iterateSubViewsForViewController(subView) {
+                return found
+            }
+        }
+
         return nil
     }
+
     #endif
-    
+
     private func hideRatingAlert() {
         if let alert = ratingAlert {
             debugLog("Hiding Alert")

                }
                
                
                if let rootController = getRootViewController() {
                    rootController.present(storeViewController, animated: usesAnimation) {
                        self.modalPanelOpen = true
                        

    }
    
    #if os(iOS)
    private static func topMostViewController(_ controller: UIViewController?) -> UIViewController? {
        var isPresenting: Bool = false
        var topController: UIViewController? = controller
        repeat {
