ObjectMapper
ObjectMapper copied to clipboard
how convenient to NSCoding?
Your JSON dictionary:
{
"name": "ObjectMapper",
"url": "https://github.com/Hearst-DD/ObjectMapper"
}
Your model:
struct Repo: Mappable {
var name: String!
var url: URL!
init(_ map: Map) {
name <- map["name"]
url <- map["url"]
}
}
What you did:
let repo = Mapper<Repo>().map(myJSONDictionary)
What you expected:
I exepected something like:
Repo(name: "ObjectMapper", url: "https://github.com/Hearst-DD/ObjectMapper")
What you got:
Repo(name: "ObjectMapper", url: nil) // expected the url is mapped correctly