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.
|
|
// // ExchangeModel.swift // GMERemittance // // Created by gme_2 on 21/08/2018. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. //
import Foundation import ObjectMapper
class ExchangeRateModel: Mappable { var country: String? var countryCode: String? var currency: String? var countryId: String? var availableServices: [PaymentServiceType]? init() {} required init?(map: Map) { } func mapping(map: Map) { country <- map["country"] countryCode <- map["countryCode"] currency <- map["currency"] countryId <- map["countryId"] availableServices <- map["serviceAvailable"] } }
extension ExchangeRateModel: TablePresenterProtocol { var cellTitle: String? { return "\(country ?? "") (\(currency ?? ""))" } var cellImage: UIImage? { return CountryEnum(rawValue: countryCode?.lowercased() ?? "")?.flag } }
class PaymentServiceType: Mappable { var id: String? var type: String? var subtitle: String? init() {} required init?(map: Map) { } func mapping(map: Map) { id <- map["id"] type <- map["text"] subtitle <- map["description"] } }
class ExchangeRateContainer: Mappable { var errorCode: String? var message: String? var id: String? var data: [ExchangeRateModel]? required init?(map: Map) { } func mapping(map: Map) { errorCode <- map["ErrorCode"] id <- map["Id"] message <- map["Msg"] data <- map["Data"] } }
|