我有一个故事板文件,我想将其用作启动屏幕。我已将故事板中的 ViewController 设置为第一个。
我也像这样设置了启动屏幕:
这是我的
SceneDelegate
中用于选择第一个 ViewController 来向用户显示的代码:
self.window = UIWindow(frame: UIScreen.main.bounds)
let vc = storyboard.instantiateViewController (withIdentifier: "Channels") as! UINavigationController
window = UIWindow(windowScene: windowScene)
window?.rootViewController = vc
window?.makeKeyAndVisible()
我第一次启动应用程序时看到启动屏幕,然后是黑屏;最后是我的用户界面。
我有结构化项目文件,并将 info.plist 移动到“RequiredFiles”文件夹中。
但是在构建设置中,info.plist 路径是“ProjectName/Info.plist”。 我将其更改为“ProjectName/RequiredFiles/Info.plist”
这解决了我的问题,希望它也能解决其他人的问题......