---
title: ExpressibleByIntegerLiteral
framework: swift
role: symbol
role_heading: Protocol
path: swift/expressiblebyintegerliteral
---

# ExpressibleByIntegerLiteral

A type that can be initialized with an integer literal.

## Declaration

```swift
protocol ExpressibleByIntegerLiteral
```

## Overview

Overview The standard library integer and floating-point types, such as Int and Double, conform to the ExpressibleByIntegerLiteral protocol. You can initialize a variable or constant of any of these types by assigning an integer literal. // Type inferred as 'Int' let cookieCount = 12

// An array of 'Int' let chipsPerCookie = [21, 22, 25, 23, 24, 19]

// A floating-point value initialized using an integer literal let redPercentage: Double = 1 // redPercentage == 1.0 Conforming to ExpressibleByIntegerLiteral To add ExpressibleByIntegerLiteral conformance to your custom type, implement the required initializer.

## Topics

### Associated Types

- [IntegerLiteralType](swift/expressiblebyintegerliteral/integerliteraltype.md)

### Initializers

- [init(integerLiteral:)](swift/expressiblebyintegerliteral/init(integerliteral:).md)

## Relationships

### Inherited By

- [BinaryFloatingPoint](swift/binaryfloatingpoint.md)
- [BinaryInteger](swift/binaryinteger.md)
- [FixedWidthInteger](swift/fixedwidthinteger.md)
- [FloatingPoint](swift/floatingpoint.md)
- [Numeric](swift/numeric.md)
- [SignedInteger](swift/signedinteger.md)
- [SignedNumeric](swift/signednumeric.md)
- [UnsignedInteger](swift/unsignedinteger.md)

### Conforming Types

- [Double](swift/double.md)
- [Float](swift/float.md)
- [Float16](swift/float16.md)
- [Float80](swift/float80.md)
- [Int](swift/int.md)
- [Int128](swift/int128.md)
- [Int16](swift/int16.md)
- [Int32](swift/int32.md)
- [Int64](swift/int64.md)
- [Int8](swift/int8.md)
- [StaticBigInt](swift/staticbigint.md)
- [UInt](swift/uint.md)
- [UInt128](swift/uint128.md)
- [UInt16](swift/uint16.md)
- [UInt32](swift/uint32.md)
- [UInt64](swift/uint64.md)
- [UInt8](swift/uint8.md)

## See Also

### Value Literals

- [ExpressibleByFloatLiteral](swift/expressiblebyfloatliteral.md)
- [ExpressibleByBooleanLiteral](swift/expressiblebybooleanliteral.md)
- [ExpressibleByNilLiteral](swift/expressiblebynilliteral.md)
- [StaticBigInt](swift/staticbigint.md)
