Closed Dbigshooter closed 8 years ago
The json result is an array of UserPackage object. This is what AlamofireJsonToObject can return from the call. So you can do something like:
Alamofire.request(apiURL + "?userid=2")
.responseArray { (response: DataResponse<[UserPackage]>) in
let result = UserPackageTransfer()
result.userPackages = response.result.value
}
@evermeer Worked like a charm, thanks!
Hi there,
I'm trying to map the following JSON:
[{"id":121, "active":true}]
Into the following object:
`class UserPackage : EVObject, Mappable {
...
I try to map it this way:
Alamofire.request(apiURL + "?userid=2", method: .get, parameters: nil, encoding: URLEncoding.default, headers: headers()).responseObject { (response: DataResponse) in
But the object I get is empty, and I'm left with:
Any suggestions?