I am developing iOS with Swift 3.
I got country name string like "Japan", "Britain", "Spain", etc.
I am wondering what is the best way to generate NSLocale instance out from the country name?
I only found localizedString(forCountryCode:) in document, it means I have to manually parse country name to country code in my project like below:
switch countryName
{
case "Spain":
"ES"
}
Is there better way to generate locale from country name?