Created
March 20, 2022 11:10
-
-
Save metin-atalay/7d32137f358762f7229fb699844be90d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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