I have my model class
class CPOption : Object, Mappable
{
dynamic var optionId : Int64 = 0
override static func primaryKey() -> String? {
return "optionId"
}
required convenience init?(map: Map) {
self.init()
}
func mapping(map: Map) {
optionId <- map["id"] //**Here i need to transform string to Int64**
}
}
Where my input JSON contain optionId as String.
"options": [
{
"id": "5121",
},
]
I need to convert this incoming string type to Int64 in Objectmapper Map function.