27 lines
1009 B
Swift
27 lines
1009 B
Swift
//
|
|
// PreferencesBuilder.swift
|
|
// PrivadoVPN
|
|
//
|
|
// Created by Murad Shabanov on 30.08.2021.
|
|
// Copyright © 2021 Privado LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
final class PreferencesBuilder {
|
|
|
|
static func build(output: PreferenceOutputProtocol) -> PreferencesViewController {
|
|
|
|
let interactor = PreferencesInteractor(customerEmitter: CustomerModuleBuilder.shared().customerEmitter)
|
|
let presenter = PreferencesPresenter(interactor: interactor, windowOutput: output)
|
|
let controller = PreferencesViewController(output: presenter, headerCreation: Self.createHeader(headerOutput: output))
|
|
presenter.viewInput = controller
|
|
|
|
return controller
|
|
}
|
|
|
|
private static func createHeader(headerOutput: PreferenceOutputProtocol) -> PreferencesViewController.HeaderCreationClosure {
|
|
return { () -> NSViewController in PreferencesHeaderBuilder.build(icon: .none, output: headerOutput, title: PreferencesPresenter.title) }
|
|
}
|
|
}
|