Skip to content

Instantly share code, notes, and snippets.

@gonelf
Created May 27, 2015 14:51
Show Gist options
  • Save gonelf/adca1dc89af807647af4 to your computer and use it in GitHub Desktop.
Save gonelf/adca1dc89af807647af4 to your computer and use it in GitHub Desktop.
Swift Country Name
func getCountryName () -> String {
let locale = NSLocale.currentLocale()
let countryCode = locale.objectForKey(NSLocaleCountryCode) as! String
let usLocale = NSLocale(localeIdentifier: "en_US")
let country = usLocale.displayNameForKey(NSLocaleCountryCode, value: countryCode)
return country!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment