From b4b99dfa8773578527ba3a11210df38dfd3913ad Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Tue, 11 Apr 2023 19:24:58 +0200 Subject: [PATCH] Integrated a WindowRouter router and a LocationsListCoordinator coordinator into the AppDelegate delegate to present the coordinator at launch time. --- Apps/Locations/Sources/AppDelegate.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Apps/Locations/Sources/AppDelegate.swift b/Apps/Locations/Sources/AppDelegate.swift index 974d077..ae859b7 100644 --- a/Apps/Locations/Sources/AppDelegate.swift +++ b/Apps/Locations/Sources/AppDelegate.swift @@ -6,15 +6,17 @@ // Copyright © 2023 Röck+Cöde. All rights reserved. // +import Core import UIKit -import CoreData @main class AppDelegate: UIResponder, UIApplicationDelegate { // MARK: Properties - var window: UIWindow? = .init(frame: UIScreen.main.bounds) + lazy var coordinator: LocationsListCoordinator = .init(router: router) + lazy var router: WindowRouter = .init(window: window) + lazy var window: UIWindow? = .init(frame: UIScreen.main.bounds) // MARK: UIApplicationDelegate @@ -22,8 +24,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - window?.rootViewController = ViewController() - window?.makeKeyAndVisible() + coordinator.present(animated: true, onDismiss: nil) return true }