protocol BooleanType
Inheritance | View Protocol Hierarchy → |
---|---|
Import | import Swift |
Instance Variables
var boolValue: Bool Required
The value of self
, expressed as a Bool
.
Declaration
var boolValue: Bool { get }
A type that represents a Boolean value.
Types that conform to the
BooleanType
protocol can be used as the condition in control statements (if
,while
, C-stylefor
) and other logical value contexts (e.g.,case
statement guards).Only three types provided by Swift,
Bool
,DarwinBoolean
, andObjCBool
, conform toBooleanType
. Expanding this set to include types that represent more than simple boolean values is discouraged.