JSONDecoder
extension JSONDecoder
                - 
                  
                  
Decodes a value of the given type for the given keypath from the JSON object.
Throws
AnErrorif the decoding process encounters an error.Declaration
Swift
public func decode<T>(_ type: T.Type, from data: Data, keyPath: String) throws -> T where T : DecodableParameters
typeThe type of value to decode.
dataThe JSON object to decode.
keyPathThe key path of the decoded value is associated with.
Return Value
A decoded value of the requested type.
 - 
                  
                  
Decodes a value of the given type for the given keypath from the JSON object and also a decoded
ListInfoif the given type is an array with a list info JSON object.Throws
AnErrorif the decoding process encounters an error.Declaration
Swift
public func decodeWithListInfo<T: Decodable>(_ type: T.Type, from data: Data, keyPath: String) throws -> (model: T, listInfo: ListInfo?)Parameters
typeThe type of value to decode.
dataThe JSON object to decode.
keyPathThe key path of the decoded value is associated with.
Return Value
A tuple containing the decoded value of the requested type as the model, and an optional
ListInfo. 
View on GitHub
        JSONDecoder Extension Reference