AppDelegate.swift中
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//定义viewcontrol常量
let vc=ViewController()
//定义一个nav常量将视图添加进去
let nav=UINavigationController(rootViewController: vc)
//将nav添加
self.window?.rootViewController=nav
//导航颜色
self.window?.backgroundColor=UIColor.white
return true
}