You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. //
  2. // AddressSearchPresenter.swift
  3. // GME Remit
  4. //
  5. // Created by InKwon Devik Kim on 22/04/2019.
  6. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class SearchAddressPresenter {
  10. // MARK: Properties
  11. weak var view: SearchAddressViewInterface?
  12. var interactor: SearchAddressInteractorInput?
  13. var wireframe: SearchAddressWireframeInput?
  14. // MARK: Converting entities
  15. }
  16. // MARK: AddressSearch module interface
  17. extension SearchAddressPresenter: SearchAddressModuleInterface {
  18. func fetchAddress(
  19. pageIndex: Int,
  20. interval: Int,
  21. keyword: String
  22. ) {
  23. self.view?.startLoading()
  24. self.interactor?.fetchAddress(pageIndex: pageIndex, interval: interval, keyword: keyword)
  25. }
  26. }
  27. // MARK: AddressSearch interactor output interface
  28. extension SearchAddressPresenter: SearchAddressInteractorOutput {
  29. func setJusoModel(with model: JusoResult?) {
  30. self.view?.endLoading()
  31. self.view?.setJusoModel(with: model)
  32. }
  33. func failure(with error: Error) {
  34. self.view?.endLoading()
  35. self.view?.failure(with: error)
  36. }
  37. }