swift 几种创建控制器的方法


 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        
        
        

        window = UIWindow.init(frame: UIScreen.main.bounds)
        
        //1.纯代码创建VC
//        window?.rootViewController = MyViewController()
        
        
        //2.SB创建VC
        window?.rootViewController = UIStoryboard.init(name: "MyViewController", bundle: nil).instantiateInitialViewController()
        window?.makeKeyAndVisible()
        
        
        
      
        return true
    }

你可能感兴趣的:(swift 几种创建控制器的方法)