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.

41 lines
868 B

  1. //
  2. // GmeContactsInteractor.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 25/08/2018.
  6. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class GmeContactsInteractor {
  10. // MARK: Properties
  11. weak var output: GmeContactsInteractorOutput?
  12. private let service: GmeContactsServiceType
  13. private let model: [Branch]?
  14. // MARK: Initialization
  15. init(service: GmeContactsServiceType, model: [Branch]?) {
  16. self.service = service
  17. self.model = model
  18. }
  19. // MARK: Converting entities
  20. }
  21. // MARK: GmeContacts interactor input interface
  22. extension GmeContactsInteractor: GmeContactsInteractorInput {
  23. func fetchBranches() {
  24. service.fetchBranches(
  25. success: {
  26. self.output?.setBranchModel(with: $0)
  27. },
  28. failure: {
  29. self.output?.setBranchesError(with: $0)
  30. }
  31. )
  32. }
  33. }