A type that can be initialized with an integer literal.
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
Overview
The standard library integer and floating-point types, such as Int
and Double
, conform to the Expressible
protocol. You can initialize a variable or constant of any of these types by assigning an integer literal.
Conforming to ExpressibleByIntegerLiteral
To add Expressible
conformance to your custom type, implement the required initializer.