Swift 不使用 main storyBoard

1、删除info.plist中Mainstoryboard file base name键值来让程序不从stroyBoard来启动

2、打开AppDelegate.swift文件,在didFinishLaunchingWithOptions中添加如下代码:

self.window = UIWindow(frame: UIScreen.main.bounds)

self.window!.makeKeyAndVisible()

let loginVC = LoginViewController()

self.window?.rootViewController = loginVC

你可能感兴趣的:(Swift 不使用 main storyBoard)