Created
October 12, 2020 20:54
-
-
Save VB10/8ba889db1178bf4612e4d7130e8f3aab 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
extension HomePresenter: HomeViewOutputs { | |
func viewDidLoad() { | |
view?.configure(entities: HomeEntities(entryEntity: HomeEntryEntity(language: "vb"))) | |
entites.catApiState = .loading | |
view?.indicatorView(animate: true) | |
dependencies.interactor.fetchCats() | |
view?.setupTableViewCell() | |
} | |
} | |
extension HomePresenter: HomeTableViewDataSourceOutputs { | |
func didSelect(_ cat: Cat) { | |
dependencies.router.navigateToDetail(httpCat: cat) | |
} | |
} | |
extension HomePresenter: HomeInteractorOutputs { | |
func onSuccessSearch(res: CatRepositoresResponse) { | |
entites.catApiState = .complete | |
entites.catRepositories = res.items | |
view?.reloadTableView(tableViewDataSource: HomeTableViewDataSoruce(entities: entites, presenter: self)) | |
view?.indicatorView(animate: false) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment