How to change rootViewController

1. Put navigation Before the ViewController.

2. Add below code in didFinishLaunchingWithOptions:

let mainStoryBoard = UIStoryboard(name: “Main”, bundle: nil)
let nvViewController = mainStoryBoard.instantiateViewController(withIdentifier: “Your_Naviagtion_stoaryBoard_given_name”) as! UINavigationController
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.rootViewController = nvNavigationViewController

By BBuniversal Team

Leave a Reply

Your email address will not be published. Required fields are marked *