Objectmapper: how can I get an array?

Created on 5 Jun 2018  路  1Comment  路  Source: tristanhimmelman/ObjectMapper

Your JSON dictionary:

{
  "list": [
            {
                  "age"  :    18,
                 "name":    "Json",
             },
             ...
]
}

class Person: Mappable {
var age: Int?
var name: String?
....
}

I don't want to create another model.
```

I want:
let people = Person

Most helpful comment

let people = Mapper<Person>().mapArray(JSONObject: json["list"])

>All comments

let people = Mapper<Person>().mapArray(JSONObject: json["list"])
Was this page helpful?
0 / 5 - 0 ratings