<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/ExpressibleByBooleanLiteral",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s27ExpressibleByBooleanLiteralP"
  },
  "title" : "ExpressibleByBooleanLiteral"
}
-->

# ExpressibleByBooleanLiteral

A type that can be initialized with the Boolean literals `true` and
`false`.

```
protocol ExpressibleByBooleanLiteral
```

## Overview

`Bool`, `DarwinBoolean`, `ObjCBool`, and `WindowsBool` are treated as
Boolean values. Expanding this set to include types that represent more than
simple Boolean values is discouraged.

To add `ExpressibleByBooleanLiteral` conformance to your custom type,
implement the `init(booleanLiteral:)` initializer that creates an instance
of your type with the given Boolean value.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)