Last active
March 20, 2022 15:55
-
-
Save metin-atalay/2767e7b9051dc27cf15af17246a67078 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
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