JSONExport is a desktop application for Mac OS X which enables you to export JSON objects as model classes with their associated constructors, utility methods, setters and getters in your favorite language.
Other
4.79k
stars
794
forks
source link
Build- time error in xcode 9.2 "No 'decodeIfPresent' candidates produce the expected contextual result type 'AnyObject?" #105
I generated the Model classes from JSON. Apparently, tool has generic type as 'AnyObject'.
If some fields has null value in JSON, it will be exported as 'AnyObject' for Swift- struct -Codable format.
Problem: Xcode 9.2 does not allow to build the project with 'AnyObject' type properties in Codable structs. I am getting the following build time error:
No 'decodeIfPresent' candidates produce the expected contextual result type 'AnyObject?
I generated the Model classes from JSON. Apparently, tool has generic type as '
AnyObject
'. If some fields has null value in JSON, it will be exported as 'AnyObject
' for Swift- struct -Codable format.Problem: Xcode 9.2 does not allow to build the project with '
AnyObject
' type properties inCodable
structs. I am getting the following build time error:No 'decodeIfPresent' candidates produce the expected contextual result type 'AnyObject?