swift appdelegate rootViewController with code

1.delete Main.storyboard
2.change .xcodeproj 中 General->Deployment Info ->Main Interface 为空
3.in appdelegate.swift

window = UIWindow(frame:UIScreen.mainScreen().bounds)
let nav = UINavigationController(rootViewController:ViewController())
window?.rootViewController = nav
window?.makeKeyAndVisible()

你可能感兴趣的:(swift appdelegate rootViewController with code)