要删除info.plist的两个地方
代码也需要修改,appDelgate:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
let viewController = ViewController()
window.rootViewController = viewController
window.makeKeyAndVisible()
self.window = window
return true
}
sceneDelegate:
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
let viewController = ViewController()
window.rootViewController = viewController
self.window = window
window.makeKeyAndVisible()
}
}
以上启动代码为单个view的,以后有空再加导航栏的写法进来。
网友评论