encodeConditional(_:)
Encodes a reference to the given object only if it is encoded unconditionally elsewhere in the payload (previously, or in the future).
Declaration
mutating func encodeConditional<T>(_ object: T) throws where T : AnyObject, T : EncodableParameters
- object:
The object to encode.
Discussion
For encoders which don’t support this feature, the default implementation encodes the given object unconditionally.
For formats which don’t support this feature, the default implementation encodes the given object unconditionally.