Skip to content

Instantly share code, notes, and snippets.

@metin-atalay
Last active March 20, 2022 15:55
Show Gist options
  • Save metin-atalay/2767e7b9051dc27cf15af17246a67078 to your computer and use it in GitHub Desktop.
Save metin-atalay/2767e7b9051dc27cf15af17246a67078 to your computer and use it in GitHub Desktop.
import Foundation
class WeatherListInteractor: WeatherListInteractorInputProtocol {
weak var presenter: WeatherListInteractorOutputProtocol?
var remoteDatamanager: WeatherListRemoteDataManagerInputProtocol?
func retrieveWeatherList(cityName: String) {
do {
remoteDatamanager?.retrieveWeatherList(cityName: cityName)
} catch {
print(error.localizedDescription)
}
}
}
extension WeatherListInteractor: WeatherListRemoteDataManagerOutputProtocol {
func onWeeatherRetrieved(_ cityInfo: WeatherModel) {
presenter?.didRetrieveWeather(cityInfo)
}
func onError() {
presenter?.onError()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment