Created
January 5, 2020 12:08
-
-
Save zafarivaev/a167b0cfc6fe4354a849d63afcba4b2d to your computer and use it in GitHub Desktop.
This file contains 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
extension QuotesPresenter: InteractorToPresenterQuotesProtocol { | |
func fetchQuotesSuccess(quotes: [APIQuote]) { | |
print("Presenter receives the result from Interactor after it's done its job.") | |
self.quotesStrings = quotes.compactMap { $0.quote } | |
view?.hideHUD() | |
view?.onFetchQuotesSuccess() | |
} | |
func fetchQuotesFailure(errorCode: Int) { | |
print("Presenter receives the result from Interactor after it's done its job.") | |
view?.hideHUD() | |
view?.onFetchQuotesFailure(error: "Couldn't fetch quotes: \(errorCode)") | |
} | |
func getQuoteSuccess(_ quote: APIQuote) { | |
router?.pushToQuoteDetail(on: view!, with: quote) | |
} | |
func getQuoteFailure() { | |
view?.hideHUD() | |
print("Couldn't retrieve quote by index") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment