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

6 years ago
6 years ago
6 years ago
  1. //
  2. // LoginPresenter.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 07/09/2018.
  6. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class LoginPresenter {
  10. // MARK: Properties
  11. weak var view: LoginViewInterface?
  12. var interactor: LoginInteractorInput?
  13. var wireframe: LoginWireframeInput?
  14. // MARK: Converting entities
  15. }
  16. // MARK: Login module interface
  17. extension LoginPresenter: LoginModuleInterface {
  18. func login(userName: String, password: String, encryptedPassword: String) {
  19. self.view?.showLoading()
  20. self.interactor?.login(userName: userName, password: password, encryptedPassword: encryptedPassword)
  21. }
  22. func register() {
  23. self.wireframe?.register()
  24. }
  25. func forgotPassword() {
  26. self.wireframe?.forgotPassword()
  27. }
  28. }
  29. // MARK: Login interactor output interface
  30. extension LoginPresenter: LoginInteractorOutput {
  31. func show(error: Error) {
  32. self.view?.hideLoading()
  33. self.view?.show(error: error.localizedDescription)
  34. }
  35. func loggedIn() {
  36. self.view?.hideLoading()
  37. self.wireframe?.dashBoard()
  38. }
  39. }