对于在 Xcode 11 上遇到此问题的任何人,如果您在进行无情节提要项目设置时遇到此问题,请按照以下方法解决
(添加一些ricardopereira遗漏的部分)
1)首先,删除Main.storyboard文件
2) 接下来,转到PROJECT_NAME -> GENERAL
在主界面下拉菜单中,删除文本Main
3) 现在转到 info.plist 并删除Storyboard Name
4) 最后,修改SceneDelegate.swift 文件中的scene(_:willConnectTo:options)代码(是的!它不再在 App Delegate 中了。)
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
window?.rootViewController = ViewController()
window?.makeKeyAndVisible()
}
您也可以参考此视频:https: //www.youtube.com/watch?v=Htn4h51BQsk