我已经在Xcode 11.1中创建了iOS项目。我需要从应用程序中删除场景委托。
答案 0 :(得分:2)
要添加到已接受的答案:您还需要在AppDelegate中编写以下内容:
self.window = UIWindow(frame: UIScreen.main.bounds)
let controller = MyRootViewController()
window?.rootViewController = navigation
window?.makeKeyAndVisible()
答案 1 :(得分:1)
您需要执行以下步骤:
答案 2 :(得分:1)
这是一个用Xcode生成的空项目的完整解决方案(带storyboard)
SceneDelegate.swift
个文件Application Scene Manifest
文件中删除 Info.plist
AppDelegate.swift
文件中
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window:UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
window?.makeKeyAndVisible()
return true
}
}