XMLCoder Documentation

Enumeration XMLDecoder.​Date​Decoding​Strategy

public enum DateDecodingStrategy  

The strategy to use for decoding Date values.

Member Of

XMLDecoder

XMLDecoder facilitates the decoding of XML into semantic Decodable types.

Enumeration Cases

deferred​ToDate

case deferredToDate

Defer to Date for decoding. This is the default strategy.

seconds​Since1970

case secondsSince1970

Decode the Date as a UNIX timestamp from a XML number. This is the default strategy.

milliseconds​Since1970

case millisecondsSince1970

Decode the Date as UNIX millisecond timestamp from a XML number.

iso8601

@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
        case iso8601

Decode the Date as an ISO-8601-formatted string (in RFC 3339 format).

formatted

case formatted(DateFormatter) 

Decode the Date as a string parsed by the given formatter.

custom

case custom((_ decoder: Decoder) throws -> Date) 

Decode the Date as a custom box decoded by the given closure.