Initializer

init(integerLiteral:)

Creates an instance initialized to the specified integer value.

Required. Default implementation provided.

Declaration

init(integerLiteral value: Self.IntegerLiteralType)

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.

Default Implementations

ExpressibleByIntegerLiteral Implementations

init(integerLiteral: Self)

Creates an instance initialized to the specified integer value.