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
1001 B

5 years ago
5 years ago
5 years ago
5 years ago
  1. //
  2. // RewardPresenter.swift
  3. // GME Remit
  4. //
  5. // Created by InKwon Devik Kim on 11/04/2019.
  6. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class RewardPresenter {
  10. // MARK: Properties
  11. weak var view: RewardViewInterface?
  12. var interactor: RewardInteractorInput?
  13. var wireframe: RewardWireframeInput?
  14. // MARK: Converting entities
  15. }
  16. // MARK: Reward module interface
  17. extension RewardPresenter: RewardModuleInterface {
  18. func viewIsReady() {
  19. view?.startLoading()
  20. interactor?.viewIsReady()
  21. }
  22. func goRedeemViewController(with model: RewardProduct?) {
  23. wireframe?.goRedeemViewController(with: model)
  24. }
  25. }
  26. // MARK: Reward interactor output interface
  27. extension RewardPresenter: RewardInteractorOutput {
  28. func setRewardProducts(models: [RewardProduct]?) {
  29. view?.endLoading()
  30. view?.setRewardProducts(models: models)
  31. }
  32. func failure(error: Error) {
  33. view?.endLoading()
  34. view?.failure(error: error)
  35. }
  36. }