XMLCoder Documentation

Enumeration XMLEncoder.​Data​Encoding​Strategy

public enum DataEncodingStrategy  

The strategy to use for encoding Data values.

Member Of


XMLEncoder facilitates the encoding of Encodable values into XML.

Enumeration Cases


case deferredToData

Defer to Data for choosing an encoding.


case base64

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


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.