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.

64 lines
1.7 KiB

5 years ago
5 years ago
  1. //
  2. // ProfileChangePhoneNumberWireframe.swift
  3. // GME Remit
  4. //
  5. // Created by Jeongbae Kong on 21/01/2020.
  6. //Copyright © 2020 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. class ChangePersonalInformationWireframe {
  10. weak var view: UIViewController!
  11. var requestModel: ChangePersonalInformationModel?
  12. weak var output: ChangePersonalInformationWireframeOutput?
  13. private var type: TargetInfo = .mobile
  14. }
  15. enum TargetInfo: String {
  16. case mobile = "m"
  17. case email = "e"
  18. }
  19. extension ChangePersonalInformationWireframe: ChangePersonalInformationWireframeInput {
  20. var storyboardName: String {return "ChangePersonalInformation"}
  21. func getMainView() -> UIViewController {
  22. let service = ChangePersonalInformationService()
  23. let interactor = ChangePersonalInformationInteractor(service: service)
  24. let presenter = ChangePersonalInformationPresenter()
  25. let viewController = viewControllerFromStoryboard(of: ChangePersonalInformationViewController.self)
  26. output = presenter
  27. viewController.presenter = presenter
  28. viewController.type = type
  29. interactor.output = presenter
  30. presenter.interactor = interactor
  31. presenter.wireframe = self
  32. presenter.view = viewController
  33. view = viewController
  34. return viewController
  35. }
  36. func openOTP(newValue: String) {
  37. self.view.openPasswordInput { (value) in
  38. self.output?.profileValidateOTP(OTPPassword: value)
  39. }
  40. }
  41. func goBackToPersonalInformation() {
  42. view.navigationController?.popViewController(animated: true)
  43. }
  44. func open(
  45. type: TargetInfo = .mobile,
  46. source: UIViewController
  47. ) {
  48. self.type = type
  49. self.pushMainView(on: source)
  50. }
  51. }