---
title: "init(booleanLiteral:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/bool/init(booleanliteral:)"
---

# init(booleanLiteral:)

Creates an instance initialized to the specified Boolean literal.

## Declaration

```swift
init(booleanLiteral value: Bool)
```

## Parameters

- `value`: The value of the new instance.

## Discussion

Discussion Do not call this initializer directly. It is used by the compiler when you use a Boolean literal. Instead, create a new Bool instance by using one of the Boolean literals true or false. var printedMessage = false

if !printedMessage {     print("You look nice today!")     printedMessage = true } // Prints "You look nice today!" In this example, both assignments to the printedMessage variable call this Boolean literal initializer behind the scenes.

## See Also

### Infrequently Used Intializers

- [init()](swift/bool/init().md)
