Generic Instance Method

encodeConditional(_:)

Encodes a reference to the given object only if it is encoded unconditionally elsewhere in the payload (previously, or in the future).

Required. Default implementation provided.

Declaration

mutating func encodeConditional<T>(_ object: T) throws where T : AnyObject, T : Encodable

Parameters

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.

Default Implementations

UnkeyedEncodingContainer Implementations

func encodeConditional<T>(T)

Encodes a reference to the given object only if it is encoded unconditionally elsewhere in the payload (previously, or in the future).