# Booleans in Swift

> An introduction to booleans in Swift using the Bool type, which holds true or false and powers conditionals like if statements and the ternary operator.

Author: Flavio Copes | Published: 2021-06-02 | Canonical: https://flaviocopes.com/swift-booleans/

> This tutorial belongs to the [Swift](https://flaviocopes.com/swift-introduction/) series

Swift provides the `Bool` type, which can have two values: `true` and `false`.

```swift
var done = false
done = true
```

Booleans are especially useful with conditional control structures like `if` statements or the ternary conditional operator:

```swift
var done = true

if done == true {
    //code
}
```
