0

I have created TableViewController by xib not on storyboard. I have view controller which loads by default. Now I want that TableViewController as root controller. Thanks in advance.

pacification
  • 5,838
  • 4
  • 29
  • 51
blackstorm
  • 60
  • 10

2 Answers2

1

1 first register you xib in particular viewController in which you want to load. by register.nibLod 2 then in AppDelegate in - didFinish method make your that particular viewController as rootviewcontroller.

0

You can do like this.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {        
    window = UIWindow(frame: UIScreen.main.bounds)  
    let navigationController: UINavigationController = UINavigationController(rootViewController: YourViewController()) //where YourViewController is name of viewController which you want to use as rootViewController
    self.window?.rootViewController = navigationController
    self.window?.makeKeyAndVisible()
    return true
}
Shahrukh
  • 740
  • 7
  • 25