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.

49 lines
1.2 KiB

5 years ago
5 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 dismiss() {
  25. self.wireframe?.dismiss()
  26. }
  27. }
  28. // MARK: MessageCompose interactor output interface
  29. extension MessageComposePresenter: MessageComposeInteractorOutput {
  30. func show(error: Error) {
  31. self.view?.show(error: error.localizedDescription)
  32. }
  33. func show(model: SuccessMessage) {
  34. self.view?.show(model: model)
  35. }
  36. }