Created
May 27, 2015 14:51
-
-
Save gonelf/adca1dc89af807647af4 to your computer and use it in GitHub Desktop.
Swift Country Name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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