Initializer

init(integerLiteral:)

Creates an instance initialized to the specified integer value. 指定された整数値に初期化されるインスタンスを作成します。

Declaration 宣言

init(integerLiteral value: UInt8)

Parameters パラメータ

value

The value to create. 作成されることになる値。

Discussion 解説

Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal. For example: このイニシャライザを直接に呼ばないでください。代わりに、整数リテラルを使って変数や定数を初期化してください。例えば:


let x = 23

In this example, the assignment to the x constant calls this integer literal initializer behind the scenes. この例において、x定数への代入は、この整数リテラルイニシャライザを舞台裏で呼びます。