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.

51 lines
1.2 KiB

  1. //
  2. // SendMoneyReceiptPresenter.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 04/09/2018.
  6. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class SendMoneyReceiptPresenter {
  10. // MARK: Properties
  11. weak var view: SendMoneyReceiptViewInterface?
  12. var interactor: SendMoneyReceiptInteractorInput?
  13. var wireframe: SendMoneyReceiptWireframeInput?
  14. // MARK: Converting entities
  15. }
  16. // MARK: SendMoneyReceipt module interface
  17. extension SendMoneyReceiptPresenter: SendMoneyReceiptModuleInterface {
  18. func openMail(controlNO: String, transactionId: String, type: MailBoxType) {
  19. self.wireframe?.openMail(controlNO: controlNO, transactionId: transactionId, type: type)
  20. }
  21. func viewIsReady(type: ReceiptType) {
  22. self.view?.showLoading()
  23. self.interactor?.viewIsReady(type: type)
  24. }
  25. func dismiss() {
  26. self.wireframe?.dismiss()
  27. }
  28. }
  29. // MARK: SendMoneyReceipt interactor output interface
  30. extension SendMoneyReceiptPresenter: SendMoneyReceiptInteractorOutput {
  31. func show(model: SendMoneyReciept) {
  32. self.view?.hideLoading()
  33. self.view?.show(model: model)
  34. }
  35. func show(error: Error) {
  36. self.view?.hideLoading()
  37. self.view?.show(error: error.localizedDescription)
  38. }
  39. }