Decodable

public extension Decodable

Usage examples: see extension Encodable

  • Decode Data into Self?

    Declaration

    Swift

    static func decode(with decoder: JSONDecoder = JSONDecoder(), from data: Data) -> Self?

    Parameters

    decoder

    defaults to JSONDecoder

    data

    previously encoded Data

    Return Value

    Self?

  • Decode String into Self?

    Declaration

    Swift

    static func decode(with decoder: JSONDecoder = JSONDecoder(), from string: String) -> Self?

    Parameters

    decoder

    defaults to JSONDecoder

    string

    previously encoded String

    Return Value

    Self?