JSONDecoder

class JSONDecoder
  • Convenience for creating a customized JSONDecoder.

    let decoder: JSONDecoder = .custom(dates: .millisecondsSince1970)
    

    Declaration

    Swift

    public static func custom(
        dates dateStrategy: JSONDecoder.DateDecodingStrategy? = nil,
        data dataStrategy: JSONDecoder.DataDecodingStrategy? = nil,
        // keys keyStrategy: JSONDecoder.KeyDecodingStrategy? = nil,
        floats floatStrategy: JSONDecoder.NonConformingFloatDecodingStrategy? = nil
    ) -> JSONDecoder

    Parameters

    dates

    Date encoding strategy.

    data

    Data encoding strategy.

    floats

    Non-conforming float encoding strategy.

    Return Value

    Newly created JSONDecoder.