Contents

init(unicodeScalarLiteral:)

Creates a Unicode scalar with the specified value.

Declaration

init(unicodeScalarLiteral value: Unicode.Scalar)

Discussion

Do not call this initializer directly. It may be used by the compiler when you use a string literal to initialize a Unicode.Scalar instance.

let letterK: Unicode.Scalar = "K"
print(letterK)
// Prints "K"

In this example, the assignment to the letterK constant is handled by this initializer behind the scenes.

See Also

Creating a Scalar