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.

60 lines
1.3 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. //
  2. // KycPresenter.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 12/09/2018.
  6. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class KycPresenter {
  10. // MARK: Properties
  11. weak var view: KycViewInterface?
  12. var interactor: KycInteractorInput?
  13. var wireframe: KycWireframeInput?
  14. // MARK: Converting entities
  15. }
  16. // MARK: Kyc module interface
  17. extension KycPresenter: KycModuleInterface {
  18. func validate(model: KYCRequestModel) {
  19. self.view?.showLoading()
  20. self.interactor?.validate(model: model)
  21. }
  22. }
  23. // MARK: Kyc interactor output interface
  24. extension KycPresenter: KycInteractorOutput {
  25. func submitSuccess() {
  26. self.wireframe?.gotToHome()
  27. }
  28. func show(result1: (isValid: Bool, errorsDick: [String : String])) {
  29. self.view?.hideLoading()
  30. self.view?.show(resultl: result1)
  31. }
  32. func show(result2: (isValid: Bool, errorsDick: [String : String])) {
  33. self.view?.hideLoading()
  34. self.view?.show(result2: result2)
  35. }
  36. func show(result3: (isValid: Bool, errorsDick: [String : String])) {
  37. self.view?.hideLoading()
  38. self.view?.show(result3: result3)
  39. }
  40. func show(error: Error) {
  41. self.view?.hideLoading()
  42. self.view?.show(error: error.localizedDescription)
  43. }
  44. }