32 lines
1.1 KiB
Swift
32 lines
1.1 KiB
Swift
//
|
|
// NotificationModuleBuilder.swift
|
|
// PrivadoVPN
|
|
//
|
|
// Created by Juraldinio on 3/28/21.
|
|
// Copyright © 2021 Privado LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
final class NotificationModuleBuilder {
|
|
|
|
static func build(output: NotificationModuleOutput?) -> (NotificationModuleInput, NotificationControllerInput) {
|
|
|
|
let filter = NotificationFilter(userDefaults: .standard)
|
|
|
|
let session = try? Session.instance()
|
|
|
|
let interactor = NotificationInteractor(session: session, filter: filter, coordinator: DatabaseAnswer.commonDB)
|
|
let presenter = NotificationPresenter(interactor: interactor, customer: CustomerModuleBuilder.shared(), output: output)
|
|
let controller = NotificationController(output: presenter, headerCreation: Self.creator())
|
|
|
|
presenter.viewInput = controller
|
|
|
|
return (presenter, controller)
|
|
}
|
|
|
|
private static func creator() -> MainController.HeaderCreationClosure {
|
|
return { () -> NSViewController in HeaderControllerBuilder.build(icon: .none) }
|
|
}
|
|
}
|