Implemented the WindowRouter router in the Coordination library.
This commit is contained in:
parent
6de4fca59e
commit
16de0feec6
@ -0,0 +1,35 @@
|
||||
//
|
||||
// WindowRouter.swift
|
||||
// ReviewsCoordinationKit
|
||||
//
|
||||
// Created by Javier Cicchelli on 21/03/2024.
|
||||
// Copyright © 2024 Röck+Cöde. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public class WindowRouter: Router {
|
||||
|
||||
// MARK: Constants
|
||||
private let window: UIWindow?
|
||||
|
||||
// MARK: Initialisers
|
||||
public init(window: UIWindow?) {
|
||||
self.window = window
|
||||
}
|
||||
|
||||
// MARK: Functions
|
||||
public func present(
|
||||
_ viewController: UIViewController,
|
||||
animated: Bool,
|
||||
onDismiss: OnDismissClosure?
|
||||
) {
|
||||
window?.rootViewController = viewController
|
||||
window?.makeKeyAndVisible()
|
||||
}
|
||||
|
||||
public func dismiss(animated: Bool) {
|
||||
// Nothing to do here...
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user