Skip to content

Instantly share code, notes, and snippets.

@metin-atalay
Created March 20, 2022 11:21
Show Gist options
  • Save metin-atalay/79f0406c7168967f7755fed09169c1a1 to your computer and use it in GitHub Desktop.
Save metin-atalay/79f0406c7168967f7755fed09169c1a1 to your computer and use it in GitHub Desktop.
import Foundation
import UIKit
class WeatherListWireFrame: WeatherListWireFrameProtocol {
class func createWeatherListModule() -> UIViewController {
let navController = mainStoryboard.instantiateViewController(withIdentifier: "WeathersNavigationController")
if let view = navController.childViewControllers.first as? WeatherListViewController {
let presenter: WeatherListPresenterProtocol & WeatherListInteractorOutputProtocol = WeatherListPresenter()
let interactor: WeatherListInteractorInputProtocol & WeatherListRemoteDataManagerOutputProtocol = WeatherListInteractor()
let remoteDataManager: WeatherListRemoteDataManagerInputProtocol = WeatherListRemoteDataManager()
let wireFrame: WeatherListWireFrameProtocol = WeatherListWireFrame()
view.presenter = presenter
presenter.view = view
presenter.wireFrame = wireFrame
presenter.interactor = interactor
interactor.presenter = presenter
interactor.remoteDatamanager = remoteDataManager
remoteDataManager.remoteRequestHandler = interactor
return view
}
return UIViewController()
}
static var mainStoryboard: UIStoryboard {
return UIStoryboard(name: "Main", bundle: Bundle.main)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment