问题描述
我是Xcode和iOS开发的新手,并且我有一个默认情况下在SwiftUI上运行的项目,我需要使用Main.storyboard来实现新屏幕
我试图放入 SceneDelegate.swift
func scene(_ scene: UIScene,willConnectTo session: UIScenesession,options connectionoptions: UIScene.Connectionoptions) {
guard let scene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: scene)
let storyboard = UIStoryboard(name: "Main",bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "HomeController") as! HomeController
window?.rootViewController = UINavigationController(rootViewController: vc)
window?.makeKeyAndVisible()}
不幸的是,它不起作用。
AppDelegate.swift
func application(_ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)