Generic Instance Method 総称体インスタンスメソッド

encodeConditional(_:forKey:)

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, forKey key: Self.Key) throws where T : AnyObject, T : Encodable

Parameters パラメータ

object

The object to encode. エンコードするオブジェクト。

key

The key to associate the object with. オブジェクトと関連付けられるキー。

Discussion 解説

For encoders which don’t support this feature, the default implementation encodes the given object unconditionally. この機能をサポートしないエンコーダに対して、省略時の実装は与えられたオブジェクトを無条件にエンコードします。

Default Implementations 省略時実装

KeyedEncodingContainerProtocol Implementations