使用代码创建 主视图
funcapplication(_application:UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey:Any]?) ->Bool{
//创建window
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
//设置主视图
letmainVC =MainViewController()
letmainNav =UINavigationController(rootViewController:mainVC)
window?.rootViewController= mainNav
return true
}
网友评论