I have JSON:
{
"id": 5,
"name": "Name of object",
"filter_ids": [ 10, 15, 20 ]
}
I use ObjectMapper for parse JSON to Realm Object.
I have vars in object:
dynamic var identifier: Int = 0
dynamic var name: String = ""
var filter_ids = List<Int>()
How to map filter_ids var?
func mapping(map: Map) {
identifier <- map["id"]
name <- map["name"]
filter_ids <- map["filter_ids"] //?????? not work
}
I used cocoaPod (carthage works too) ObjectMapperAdditions
It works for Int, String, Bool arrays.
Duplicated discussion