Integrated the FeedListCoordinator and the AppCoordinator coordinators into the AppDelegate in the App target.

This commit is contained in:
Javier Cicchelli 2024-03-21 19:49:55 +01:00
parent 402a4933ca
commit 67c391dbba

View File

@ -6,6 +6,7 @@
// Copyright © 2020 ING. All rights reserved. // Copyright © 2020 ING. All rights reserved.
// //
import ReviewsCoordinationKit
import ReviewsFeed import ReviewsFeed
import UIKit import UIKit
@ -13,6 +14,7 @@ import UIKit
class AppDelegate: UIResponder { class AppDelegate: UIResponder {
// MARK: Properties // MARK: Properties
var coordinator: AppCoordinator?
var window: UIWindow? var window: UIWindow?
} }
@ -26,9 +28,19 @@ extension AppDelegate: UIApplicationDelegate {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds) window = UIWindow(frame: UIScreen.main.bounds)
coordinator = .init(router: WindowRouter(window))
guard let coordinator else {
fatalError("AppCoordinator should have been instantiated")
}
window?.rootViewController = UINavigationController(rootViewController: FeedListViewController()) coordinator.present(animated: false)
window?.makeKeyAndVisible() coordinator.present(
child: FeedListCoordinator(
router: StackRouter(coordinator.navigationController)
),
animated: false
)
return true return true
} }