mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-07 04:48:34 +00:00
Small tweaks.
This commit is contained in:
@@ -10,7 +10,7 @@ import UIKit
|
|||||||
@main
|
@main
|
||||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
|
|
||||||
private var appCoordinator: Coordinator!
|
private lazy var appCoordinator: Coordinator = isRunningUITests ? UITestsAppCoordinator() : AppCoordinator()
|
||||||
|
|
||||||
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
|
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
|
||||||
|
|
||||||
@@ -26,13 +26,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if isRunningUITests {
|
|
||||||
appCoordinator = UITestsAppCoordinator()
|
|
||||||
} else {
|
|
||||||
appCoordinator = AppCoordinator()
|
|
||||||
}
|
|
||||||
|
|
||||||
appCoordinator.start()
|
appCoordinator.start()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ class UITestsAppCoordinator: Coordinator {
|
|||||||
|
|
||||||
let screens = mockScreens()
|
let screens = mockScreens()
|
||||||
let rootView = UITestsRootView(mockCoordinators: screens) { id in
|
let rootView = UITestsRootView(mockCoordinators: screens) { id in
|
||||||
guard let coordinator = screens.filter({ $0.id == id }).first else {
|
guard let screen = screens.filter({ $0.id == id }).first else {
|
||||||
fatalError()
|
fatalError()
|
||||||
}
|
}
|
||||||
|
|
||||||
self.mainNavigationController.pushViewController(coordinator.coordinator.toPresentable(), animated: true)
|
self.mainNavigationController.pushViewController(screen.coordinator.toPresentable(), animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
mainNavigationController.setViewControllers([UIHostingController(rootView: rootView)], animated: false)
|
mainNavigationController.setViewControllers([UIHostingController(rootView: rootView)], animated: false)
|
||||||
|
|||||||
Reference in New Issue
Block a user