JSONDecodable
public protocol JSONDecodable: Decodable
JSONDecodable protocol with an init for JSON. Conforms to Decodable protocol
-
init(from:)
Default implementationinit from JSON object
Default Implementation
- return JSONDecodable object from JSON or nil if the decode fails
- return JSONDecodable object from JSON Data or nil if the decode fails
Declaration
Swift
init?(from json: JSON)
-
init from JSON data
Declaration
Swift
init?(from data: Data)
-
jsonDecoder
Default implementationDefault JSONDecoder. This is mainly to be used by child protocols that need custom decoders
Default Implementation
-return basic JSONDecoder. This is meant to be used by child protocols that need custom decoders
Declaration
Swift
static var jsonDecoder: JSONDecoder