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

# ExpressibleByUnicodeScalarLiteral

A type that can be initialized with a string literal containing a single
Unicode scalar value.

```
protocol ExpressibleByUnicodeScalarLiteral
```

## Overview

The `String`, `StaticString`, `Character`, and `Unicode.Scalar` types all
conform to the `ExpressibleByUnicodeScalarLiteral` protocol. You can
initialize a variable of any of these types using a string literal that
holds a single Unicode scalar.

```
let ñ: Unicode.Scalar = "ñ"
print(ñ)
// Prints "ñ"
```

# Conforming to ExpressibleByUnicodeScalarLiteral

To add `ExpressibleByUnicodeScalarLiteral` conformance to your custom type,
implement the required initializer.

---

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)