Initializer

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.

Relationships

See Also

Creating a Scalar

init(UInt8)

Creates a Unicode scalar with the specified numeric value.

init(Unicode.Scalar)

Creates a duplicate of the given Unicode scalar.

init?(UInt32)

Creates a Unicode scalar with the specified numeric value.

init?(UInt16)

Creates a Unicode scalar with the specified numeric value.

init?(Int)

Creates a Unicode scalar with the specified numeric value.