-
Notifications
You must be signed in to change notification settings - Fork 384
/
Copy pathIPOverrideCoordinator.swift
50 lines (41 loc) · 1.49 KB
/
IPOverrideCoordinator.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// IPOverrideCoordinator.swift
// MullvadVPN
//
// Created by Jon Petersson on 2024-01-15.
// Copyright © 2024 Mullvad VPN AB. All rights reserved.
//
import MullvadSettings
import MullvadTypes
import Routing
import UIKit
class IPOverrideCoordinator: Coordinator, Presenting, SettingsChildCoordinator {
private let navigationController: UINavigationController
private let interactor: IPOverrideInteractor
var presentationContext: UIViewController {
navigationController
}
init(
navigationController: UINavigationController,
repository: IPOverrideRepositoryProtocol,
tunnelManager: TunnelManager
) {
self.navigationController = navigationController
interactor = IPOverrideInteractor(repository: repository, tunnelManager: tunnelManager)
}
func start(animated: Bool) {
let controller = IPOverrideViewController(
interactor: interactor,
alertPresenter: AlertPresenter(context: self)
)
controller.delegate = self
navigationController.pushViewController(controller, animated: animated)
}
}
extension IPOverrideCoordinator: IPOverrideViewControllerDelegate {
func presentImportTextController() {
let viewController = IPOverrideTextViewController(interactor: interactor)
let customNavigationController = CustomNavigationController(rootViewController: viewController)
presentationContext.present(customNavigationController, animated: true)
}
}