38 lines
1.1 KiB
Swift
38 lines
1.1 KiB
Swift
//
|
|
// UpgradeModuleBuilder.swift
|
|
// PrivadoVPN
|
|
//
|
|
// Created by Zhandos Bolatbekov on 29.01.2021.
|
|
// Copyright © 2021 Privado LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import UIKit
|
|
|
|
protocol UpgradeModuleOutput: AnyObject {
|
|
func navigate(to route: Route)
|
|
}
|
|
|
|
final class UpgradeModuleBuilder {
|
|
|
|
static func build(output: UpgradeModuleOutput?) -> UIViewController {
|
|
|
|
let interactor = UpgradeInteractor(router: Environment.router,
|
|
apiKey: PrivadoConstants.Session.key)
|
|
|
|
let presenter = UpgradePresenter(interactor: interactor,
|
|
customerRepo: CustomerRepo.instance,
|
|
session: Session.shared(),
|
|
output: output)
|
|
if DeviceInfoProvider.isIPad {
|
|
let controller = ModalControllerIPAD(output: presenter)
|
|
presenter.modalViewInput = controller
|
|
return controller
|
|
} else {
|
|
let view = UpgradeView(output: presenter)
|
|
presenter.viewInput = view
|
|
return view
|
|
}
|
|
}
|
|
}
|