XMLCoder Documentation

Enumeration XMLEncoder.​Data​Encoding​Strategy

public enum DataEncodingStrategy  

The strategy to use for encoding Data values.

Member Of

XMLEncoder

XMLEncoder facilitates the encoding of Encodable values into XML.

Enumeration Cases

deferred​ToData

case deferredToData

Defer to Data for choosing an encoding.

base64

case base64

Encoded the Data as a Base64-encoded string. This is the default strategy.

custom

case custom((Data, Encoder) throws -> ()) 

Encode the Data as a custom value encoded by the given closure.

If the closure fails to encode a value into the given encoder, the encoder will encode an empty automatic container in its place.