Set rootViewController of UINavigationController by method other than initWithRootViewController

后端 未结 5 795
死守一世寂寞
死守一世寂寞 2020-12-02 11:45

How Do I set the rootViewController of UINavigationController by a method other than initWithRootViewController?

I want use

5条回答
  •  醉话见心
    2020-12-02 12:21

    In swift 3.0 xcode8.1

    in general settings delete in Main Interface: Main <-this after Main Interface:

    class AppDelegate...
    
     var window: UIWindow?
    
        fun application...
    
          window = UIWindow(frame: UIScreen.main.bounds)
          window?.makeKeyAndVisible()
          window?.rootViewController = UINavigationController(rootViewController: NewYourController)
    

提交回复
热议问题