Implemented the WindowRouter router in the Core library.
This commit is contained in:
parent
c3fc42d724
commit
30bb62e795
@ -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...
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user