<!--
{
  "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/ExpressibleByNilLiteral",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s23ExpressibleByNilLiteralP"
  },
  "title" : "ExpressibleByNilLiteral"
}
-->

# ExpressibleByNilLiteral

A type that can be initialized using the nil literal, `nil`.

```
protocol ExpressibleByNilLiteral : ~Copyable, ~Escapable
```

## Overview

`nil` has a specific meaning in Swift—the absence of a value. Only the
`Optional` type conforms to `ExpressibleByNilLiteral`.
`ExpressibleByNilLiteral` conformance for types that use `nil` for other
purposes is discouraged.

## Relationships

### Conforming Types

[`Optional`](/documentation/Swift/Optional)

---

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)