Date

extension Date: Decodable, DynamicDecodable
  • Default decoder is Date.decoder(using: iso8601DateFormatter)

    Declaration

    Swift

    public static var decoder: (Any) throws -> Date
  • Create a decode closure using a given formatter

    Example usage:

    let formatter = DateFormatter(...)
    Date.decoder = Date.decoder(using: formatter)
    

    Declaration

    Swift

    public static func decoder(using formatter: DateFormatter) -> (Any) throws -> Date