Skip to content

Instantly share code, notes, and snippets.

@zafarivaev
Created January 5, 2020 12:01
Show Gist options
  • Save zafarivaev/804ddc1dd878d050118d4e6a45706803 to your computer and use it in GitHub Desktop.
Save zafarivaev/804ddc1dd878d050118d4e6a45706803 to your computer and use it in GitHub Desktop.
extension QuotesViewController: PresenterToViewQuotesProtocol{
func onFetchQuotesSuccess() {
print("View receives the response from Presenter and updates itself.")
self.tableView.reloadData()
self.refreshControl.endRefreshing()
}
func onFetchQuotesFailure(error: String) {
print("View receives the response from Presenter with error: \(error)")
self.refreshControl.endRefreshing()
}
func showHUD() {
HUD.show(.progress, onView: self.view)
}
func hideHUD() {
HUD.hide()
}
func deselectRowAt(row: Int) {
self.tableView.deselectRow(at: IndexPath(row: row, section: 0), animated: true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment