matthewcheok / JSONCodable

Hassle-free JSON encoding and decoding in Swift
MIT License
602 stars 66 forks source link

JSONDecoder is ambiguous for type lookup #81

Open pronebird opened 7 years ago

pronebird commented 7 years ago

JSONDecoder is now a part of Foundation on iOS 11 and there is no way to use JSONDecoder anymore because there are now two of them. I have a code that extends both JSONDecoder and JSONEncoder and both throw an error on Xcode 9 beta:

'JSONDecoder' is ambiguous for type lookup in this context

It seems like JSONCodable will have to prefix its classes.

matthewcheok commented 7 years ago

Ideally, this library would become obsolete and we'd migrate to the new built-in Codable protocol in Swift 4. The only possible issue would be if we wanted to support multiple versions of iOS - it's possible the new API is available retrospectively since the Swift runtime is bundled with the application but I have yet to test this.

emilwojtaszek commented 7 years ago

I've fixed this in https://github.com/matthewcheok/JSONCodable/pull/82