У меня проблемы с роутером в новом проекте.
Раньше он работал, когда AppDelegate был функцией запуска, но теперь со сценой не работает.
Вот код
class Router {
static let shared = Router()
private init() {}
func root(_ window: inout UIWindow?,_ scene: UIScene?) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
let rootViewController: LoginViewController = LoginViewController()
window!.rootViewController = rootViewController
window?.makeKeyAndVisible()
}
}
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let scene = (scene as? UIWindowScene) else { return }
Router.shared.root(&window, scene)
}