Last active
January 9, 2016 22:37
-
-
Save ericdke/d23b341d6a73fa8b8a47 to your computer and use it in GitHub Desktop.
Get list of country names
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 getAllCountryNames() -> [String] { | |
| let countryCodes = NSLocale.ISOCountryCodes() | |
| return countryCodes.map() { countryCode in | |
| return NSLocale.currentLocale().displayNameForKey(NSLocaleCountryCode, value : countryCode)! | |
| } | |
| } | |
| print(getAllCountryNames()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment