I have following code in my AppDelegate.swift to setup root view controller for an iOS application. But it does not work. It follows Target structure (defined under General
let MainViewController = mainStoryboard.instantiateViewController(withIdentifier: "MainViewController") as! MainViewController
let nvc:rootNavigation = mainStoryboard.instantiateViewController(withIdentifier: "rootNavigation") as! rootNavigation
nvc.viewControllers = [Mainmap]
leftViewController.mainViewController = nvc
UIApplication.shared.windows.first?.backgroundColor = UIColor(red: 236.0, green: 238.0, blue: 241.0, alpha: 1.0)
UIApplication.shared.windows.first?.rootViewController = nvc
UIApplication.shared.windows.first?.makeKeyAndVisible()