47 lines
972 B
Swift

//
// SpyRouter.swift
// ReviewsCoordinationTest
//
// Created by Javier Cicchelli on 21/03/2024.
// Copyright © 2024 Röck+Cöde. All rights reserved.
//
import ReviewsCoordinationKit
import UIKit
final class SpyRouter: Router {
// MARK: Properties
var animated: Bool?
var onDismiss: OnDismissClosure?
var state: State = .initialised
var viewController: UIViewController?
// MARK: Functions
func present(
_ viewController: UIViewController,
animated: Bool,
onDismiss: OnDismissClosure?
) {
self.viewController = viewController
self.animated = animated
self.onDismiss = onDismiss
self.state = .presented
}
func dismiss(animated: Bool) {
self.animated = animated
self.state = .dismissed
}
}
// MARK: - Enumerations
extension SpyRouter {
enum State {
case initialised
case presented
case dismissed
}
}