A type that can be initialized with the Boolean literals true
and false
.
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
Overview
Only three types provided by Swift—Bool
, Darwin
, and Obj
—are treated as Boolean values. Expanding this set to include types that represent more than simple Boolean values is discouraged.
To add Expressible
conformance to your custom type, implement the init(boolean
initializer that creates an instance of your type with the given Boolean value.