Skip to content

Instantly share code, notes, and snippets.

@metin-atalay
Created March 20, 2022 11:10
Show Gist options
  • Save metin-atalay/7d32137f358762f7229fb699844be90d to your computer and use it in GitHub Desktop.
Save metin-atalay/7d32137f358762f7229fb699844be90d to your computer and use it in GitHub Desktop.
class WeatherListPresenter: WeatherListPresenterProtocol {
weak var view: WeatherListViewProtocol?
var interactor: WeatherListInteractorInputProtocol?
var wireFrame: WeatherListWireFrameProtocol?
func viewDidLoad(cityName: String) {
view?.showLoading()
interactor?.retrieveWeatherList(cityName: cityName)
}
}
extension WeatherListPresenter: WeatherListInteractorOutputProtocol {
func didRetrieveWeather(_ cityInfo: WeatherModel) {
view?.hideLoading()
view?.showWeatherInfo(weathers: cityInfo)
}
func onError() {
view?.hideLoading()
view?.showError()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment