localizedString(forCountryCode:)
Returns the localized string for a country or region code.
Declaration
func localizedString(forCountryCode countryCode: String) -> String?Parameters
- countryCode:
The code of the country or region that indicates the name you want.
Return Value
The localized name of the country or region.
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
Related Documentation
Getting Display Information About a Locale
localizedString(forLocaleIdentifier:)localizedString(forLanguageCode:)localizedString(forScriptCode:)localizedString(forVariantCode:)localizedString(forCollationIdentifier:)localizedString(forCollatorIdentifier:)localizedString(forCurrencyCode:)localizedString(forCalendarIdentifier:)Locale Calendar Identifiers