protocol
ExpressibleByUnicodeScalarLiteral
Inheritance | View Protocol Hierarchy → |
---|---|
Associated Types |
A type that represents a Unicode scalar literal. Valid types for |
Import |
|
Initializers
Creates an instance initialized to the given value.
value
: The value of the new instance.
Declaration
init
(
unicodeScalarLiteral
value
:
Self
.
UnicodeScalarLiteralType
)
A type that can be initialized with a string literal containing a single Unicode scalar value.
The
String
,StaticString
,Character
, andUnicodeScalar
types all conform to theExpressibleByUnicodeScalarLiteral
protocol. You can initialize a variable of any of these types using a string literal that holds a single Unicode scalar.Conforming to ExpressibleByUnicodeScalarLiteral
To add
ExpressibleByUnicodeScalarLiteral
conformance to your custom type, implement the required initializer.