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.

53 lines
1.4 KiB

5 years ago
5 years ago
5 years ago
2 years ago
5 years ago
5 years ago
  1. //
  2. // MessageComposePresenter.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 02/10/2018.
  6. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class MessageComposePresenter {
  10. // MARK: Properties
  11. weak var view: MessageComposeViewInterface?
  12. var interactor: MessageComposeInteractorInput?
  13. var wireframe: MessageComposeWireframeInput?
  14. // MARK: Converting entities
  15. }
  16. // MARK: MessageCompose module interface
  17. extension MessageComposePresenter: MessageComposeModuleInterface {
  18. func cancel(control: String, transId: String, subject: String, body: String) {
  19. self.interactor?.cancel(control: control, transId: transId, subject: subject, body: body)
  20. }
  21. func edit(control: String, transId: String, subject: String, body: String) {
  22. self.interactor?.edit(control: control, transId: transId, subject: subject, body: body)
  23. }
  24. func pending(control: String, transId: String, subject: String, body: String) {
  25. self.interactor?.pending(control: control, transId: transId, subject: subject, body: body)
  26. }
  27. func dismiss() {
  28. self.wireframe?.dismiss()
  29. }
  30. }
  31. // MARK: MessageCompose interactor output interface
  32. extension MessageComposePresenter: MessageComposeInteractorOutput {
  33. func show(error: Error) {
  34. self.view?.show(error: error.localizedDescription)
  35. }
  36. func show(model: SuccessMessage) {
  37. self.view?.show(model: model)
  38. }
  39. }