tristanhimmelman / ObjectMapper

Simple JSON Object mapping written in Swift
MIT License
9.13k stars 1.03k forks source link

ObjectMapper is show alert "SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0." #1104

Open JARNBOY opened 4 years ago

JARNBOY commented 4 years ago

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