Initializer

init(from:)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is UInt8. 新しいインスタンスをこの与えられたデコーダからデコードすることによって作成します、型のもつRawValueUInt8である場合。

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. このイニシャライザは、デコーダからの読み出しが失敗するならば、または読み込んだデータが不正またはそうでなくとも無効ならば、エラーをスローします。