主界面不会随着Xcode11中的另一个故事板而改变,它总是在与另一个故事板改变后与Main.storyboard一起运行,在新的故事板中使用视图控制器后,我已经检查了“是初始视图控制器”。
我在Xcode10上测试过,它工作得很好。
我是不是在Xcode11中遗漏了什么?




在plist中。

发布于 2019-09-24 19:52:54
带有iOS 13的Swift 5
在应用程序场景清单组下的info.plist文件中还需要进行一处更改。

同时更改应用程序场景清单中的名称。
附加:
如果要在没有情节提要的情况下创建根窗口,则需要从Info.plist中移除Main storyboard file base name和Storyboard Name项,然后在SceneDelegate中以编程方式创建窗口
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
@available(iOS 13.0, *)
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(windowScene: windowScene)
// continue to create view controllers for window
}
//......
}发布于 2019-09-24 15:24:19
请将“主情节提要文件库名称”更改为您的情节提要文件名。
https://stackoverflow.com/questions/58074878
复制相似问题