Implemented the WindowRouter router in the Core library.

This commit is contained in:
Javier Cicchelli 2023-04-11 18:14:20 +02:00
parent c3fc42d724
commit 30bb62e795

View File

@ -0,0 +1,39 @@
//
// WindowRouter.swift
// Core
//
// Created by Javier Cicchelli on 11/04/2023.
// Copyright © 2023 Röck+Cöde. All rights reserved.
//
import UIKit
public class WindowRouter: Router {
// MARK: Properties
private let window: UIWindow?
// MARK: Initialisers
public init(window: UIWindow?) {
self.window = window
}
// MARK: Functions
public func present(
_ viewController: UIViewController,
animated: Bool,
onDismiss: OnDismissedClosure?
) {
window?.rootViewController = viewController
window?.makeKeyAndVisible()
}
public func dismiss(animated: Bool) {
// Nothing to do here...
}
}