Initializer

init(booleanLiteral:)

Creates an instance initialized to the given Boolean value.

Required.

Declaration

init(booleanLiteral value: Self.BooleanLiteralType)

Parameters

value

The value of the new instance.

Discussion

Do not call this initializer directly. Instead, initialize a variable or constant using one of the Boolean literals true and false. For example:

let twasBrillig = true

In this example, the assignment to the twasBrillig constant calls this Boolean literal initializer behind the scenes.