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.

61 lines
1.3 KiB

5 years ago
5 years ago
  1. //
  2. // SplashScreenPresenter.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 10/09/2018.
  6. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class SplashScreenPresenter {
  10. // MARK: Properties
  11. weak var view: SplashScreenViewInterface?
  12. var interactor: SplashScreenInteractorInput?
  13. var wireframe: SplashScreenWireframeInput?
  14. // MARK: Converting entities
  15. }
  16. // MARK: SplashScreen module interface
  17. extension SplashScreenPresenter: SplashScreenModuleInterface {
  18. func login() {
  19. self.wireframe?.login()
  20. }
  21. func register() {
  22. self.wireframe?.register()
  23. }
  24. func fetchExchangeRate() {
  25. view?.showLoading()
  26. interactor?.fetchExchangeRate()
  27. }
  28. func exchangeCalculate(use model: ExchangeRateRequestModel) {
  29. view?.showLoading()
  30. interactor?.exchangeCalculate(use: model)
  31. }
  32. }
  33. // MARK: SplashScreen interactor output interface
  34. extension SplashScreenPresenter: SplashScreenInteractorOutput {
  35. func setModel(with model: [ExchangeRateModel]?) {
  36. view?.hideLoading()
  37. view?.setModel(with: model)
  38. }
  39. func setModel(with model: ExchangeRateDetailModel?) {
  40. view?.hideLoading()
  41. view?.setModel(with: model)
  42. }
  43. func setError(with error: Error) {
  44. view?.hideLoading()
  45. view?.setError(with: error)
  46. }
  47. }