Implemented the Router protocol in the Coordination library.
This commit is contained in:
parent
2fffe99807
commit
1b4fde9adb
42
Libraries/Coordination/Kit/Sources/Protocols/Router.swift
Normal file
42
Libraries/Coordination/Kit/Sources/Protocols/Router.swift
Normal file
@ -0,0 +1,42 @@
|
||||
//
|
||||
// Router.swift
|
||||
// ReviewsCoordinationKet
|
||||
//
|
||||
// Created by Javier Cicchelli on 21/03/2024.
|
||||
// Copyright © 2024 Röck+Cöde. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public protocol Router: AnyObject {
|
||||
|
||||
// MARK: Type aliases
|
||||
typealias OnDismissClosure = () -> Void
|
||||
|
||||
// MARK: Functions
|
||||
func present(
|
||||
_ viewController: UIViewController,
|
||||
animated: Bool,
|
||||
onDismiss: OnDismissClosure?
|
||||
)
|
||||
|
||||
func dismiss(animated: Bool)
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Implementations
|
||||
public extension Router {
|
||||
|
||||
// MARK: Functions
|
||||
func present(
|
||||
_ viewController: UIViewController,
|
||||
animated: Bool
|
||||
) {
|
||||
present(
|
||||
viewController,
|
||||
animated: animated,
|
||||
onDismiss: nil
|
||||
)
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user