         }else{
             return vcResult
         }
+        
+    }
+    
+    open class func getCurrentNavigationController() -> UINavigationController?{
+        if let currentVC = getCurrentViewController(){
+            if currentVC.isKind(of: UINavigationController.self){
+                return (currentVC as! UINavigationController)
+            }else{
+                return currentVC.navigationController
+            }
+        }
+        return nil
         
     }
     

            let _ = from.navigationController?.popToViewController(to, animated: animated)
        }
    }
}

        }
    }
    
    open class func popTo(_ from: UIViewController, toType: UIViewController.Type, animated: Bool = true){        
        if let vc = getFirstVCFromCurrentNavigationController(toType){
            popTo(from, to: vc, animated: animated)
        }
    }
    
    open class func popTo(_ from: UIViewController, to: UIViewController, animated: Bool = true){
