uinavigationContoller(rootviewController:viewController())scenedelegate xcode 15.0通过编程方式
我无法在屏幕上获得结果。 在此处输入图像描述 这是我在SceneDelegate SceneDelegate内部的代码的示例
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
window?.rootViewController = UINavigationController(rootViewController: ViewController())
window?.makeKeyAndVisible()
}
}
不幸的是,我无法获得预期的结果。 在此处输入图像描述 请帮助我了解SceneDelegate内部使用UinavController制作应用程序的结构。我正在学习只能以编程方式而没有故事板 Xcode的版本为15.0
I can't get a result like in the screenshoot. enter image description here
Here is an example of my code inside of SceneDelegate
SceneDelegate
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
window?.rootViewController = UINavigationController(rootViewController: ViewController())
window?.makeKeyAndVisible()
}
}
Unfortunately I can't get the expected result. enter image description here
Please help me to understand the structure of making app with UiNavController inside SceneDelegate. I'm learning to make the apps only programmatically without StoryBoard
Version of Xcode is 15.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本导航controller是
the base navigationController is