I have multiple navigation controllers. They are placed like this hierarchy :

```
(A)SWRevealViewController
       (B)Navigation Controller(sw_front) 
            (C)HomeViewController (root view controller)
                  (D)TabBarController -->
                            (E)Navigation Controller 1--> 
                                 (F)TableController 1 -->
                                 (F)TableController 2.
                            (E)Navigation Controller 2--> 
                                 (F)TableController 1 -->
                                 (F)TableController 2.

```

I want to pop to the root view controller of the main navigation controllers, i.e, I want to go from F to C or B. I have referred to [this](https://stackoverflow.com/a/28426793/7205816) answer, and also converted it to swift as follows :

```
let appdel: AppDelegate = UIApplication.shared.delegate as! AppDelegate
    let mainwindow : UIWindow = appdel.window!
    let vcObj : HomeViewController = HomeViewController()
    let navObj : UINavigationController = UINavigationController(rootViewController: vcObj)
    mainwindow.rootViewController = navObj

```

but it just shows a blank black screen. Please can anyone help.

I am using Xcode 8 and Swift 3.