Contents

localizedString(forVariantCode:)

Returns the localized string for the specified variant code.

Declaration

func localizedString(forVariantCode variantCode: String) -> String?

Parameters

  • variantCode:

    The variant code whose name you want.

Return Value

The localized name of the variant.

Discussion

For example, calling this method on an American English (en_US) locale, passing "POSIX" for variantCode, produces the string "Computer".

This method is equivalent to calling the displayName(forKey:value:) method passing the variantCode key and variantCode value.

See Also

Getting Display Information About a Locale