Instance Method

localizedString(forCountryCode:)

Returns the localized string for the specified country code.

Declaration

func localizedString(forCountryCode countryCode: String) -> String?

Parameters

countryCode

The country code indicating the country whose name you want.

Return Value

The localized name of the country for the given code.

Discussion

For example, calling this method on an American English (en_US) locale, passing "GB" for countryCode, produces the string "United Kingdom".

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

See Also

Getting Display Information About a Locale

func localizedString(forLocaleIdentifier: String) -> String

Returns the localized string for the specified locale identifier.

func localizedString(forLanguageCode: String) -> String?

Returns the localized string for the specified language code.

func localizedString(forScriptCode: String) -> String?

Returns the localized string for the specified script code.

func localizedString(forVariantCode: String) -> String?

Returns the localized string for the specified variant code.

func localizedString(forCollationIdentifier: String) -> String?

Returns the localized string for the specified collation identifier.

func localizedString(forCollatorIdentifier: String) -> String?

Returns the localized string for the specified collator identifier.

func localizedString(forCurrencyCode: String) -> String?

Returns the localized string for the specified currency code.

func localizedString(forCalendarIdentifier: String) -> String?

Returns the localized string for the specified calendar identifier.