Skip to content

Initializer

init(stringLiteral:)

iOS 16.0+ iPadOS 16.0+ Mac Catalyst 16.0+ macOS 13.0+ tvOS 16.0+ watchOS 9.0+
Creates a language code from an identifier as a string literal.
init(stringLiteral value: String)

Parameters

value

A two-letter ISO 639-1 or three-letter ISO 639-2 code, such as en for English. You can also use a code of your own choice for a custom language.