Initializer

init(from:)

Creates a new instance by decoding from the given decoder. 与えられたデコーダからデコードすることで新しいインスタンスを作成します。

Declaration 宣言

init(from decoder: Decoder) throws

Parameters パラメータ

decoder

The decoder to read data from. それからデータを読み出すデコーダ。

Discussion 解説

This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid. このイニシャライザは、デコーダからの読み出しが失敗するならば、または読み込んだデータが不正またはそうでなくとも無効ならば、エラーをスローします。

Relationships 関係

From Protocol 由来プロトコル

See Also 参照

Encoding and Decoding エンコーディングとデコーディング