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.

35 lines
830 B

5 years ago
  1. //
  2. // CountryAndServiceModel.swift
  3. // GME Remit
  4. //
  5. // Created by InKwon James Kim on 20/08/2019.
  6. // Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import ObjectMapper
  9. struct CountryAndServiceModel: Mappable {
  10. var countryName: String?
  11. var countryCode: String?
  12. var countryId: String?
  13. var availableServices: [PaymentServiceType]?
  14. init(map: Map) {}
  15. mutating func mapping(map: Map) {
  16. countryName <- map["countryName"]
  17. countryCode <- map["countryCode"]
  18. countryId <- map["countryId"]
  19. availableServices <- map["servicetypeAvailable"]
  20. }
  21. }
  22. extension CountryAndServiceModel: TablePresenterProtocol {
  23. var cellTitle: String? {
  24. return "\(countryName ?? "")"
  25. }
  26. var cellImage: UIImage? {
  27. return CountryEnum(rawValue: countryCode?.lowercased() ?? "")?.flag
  28. }
  29. }