/CountryLibAutomator

Swift script to generate Country enumerator with emoji and local language country name

Primary LanguageSwift

CountryLibAutomator

Swift script to generate Country enumerator with emoji and local language country name

How to use it?

Just download Country.swift file to start using!

See for yourself:

let brazil = Country.br

print(brazil.englishName) // Brazil
print(brazil.nativeName) // Brasil
print(brazil.iPhoneLanguageName) // Brazil
print(brazil.flag) // ๐Ÿ‡ง๐Ÿ‡ท
print(brazil.phoneCode.first!) // +55
print(brazil.spokenLanguages.first!) // pt

And thanks to user Kametrixom on StackOverflow you can use it on a Picker View.

for country in Country.cases() {
    print("\(country.flag) \(country.englishName) \(country.phoneCode.first!)")
}

//๐Ÿ‡ฆ๐Ÿ‡ฉ Andorra +376
//๐Ÿ‡ฆ๐Ÿ‡ช United Arab Emirates +971
//๐Ÿ‡ฆ๐Ÿ‡ซ Afghanistan +93
//๐Ÿ‡ฆ๐Ÿ‡ฌ Antigua and Barbuda +1268
//๐Ÿ‡ฆ๐Ÿ‡ฎ Anguilla +1264
//๐Ÿ‡ฆ๐Ÿ‡ฑ Albania +355
//๐Ÿ‡ฆ๐Ÿ‡ฒ Armenia +374
//๐Ÿ‡ฆ๐Ÿ‡ด Angola +244
//๐Ÿ‡ฆ๐Ÿ‡ถ Antarctica +672
//๐Ÿ‡ฆ๐Ÿ‡ท Argentina +54
//๐Ÿ‡ฆ๐Ÿ‡ธ American Samoa +1684
//๐Ÿ‡ฆ๐Ÿ‡น Austria +43
//๐Ÿ‡ฆ๐Ÿ‡บ Australia +61
//๐Ÿ‡ฆ๐Ÿ‡ผ Aruba +297
//๐Ÿ‡ฆ๐Ÿ‡ฝ ร…land +358
//๐Ÿ‡ฆ๐Ÿ‡ฟ Azerbaijan +994
//๐Ÿ‡ง๐Ÿ‡ฆ Bosnia and Herzegovina +387
//๐Ÿ‡ง๐Ÿ‡ง Barbados +1246
//๐Ÿ‡ง๐Ÿ‡ฉ Bangladesh +880
//๐Ÿ‡ง๐Ÿ‡ช Belgium +32
//๐Ÿ‡ง๐Ÿ‡ซ Burkina Faso +226
//๐Ÿ‡ง๐Ÿ‡ฌ Bulgaria +359
//๐Ÿ‡ง๐Ÿ‡ญ Bahrain +973
//๐Ÿ‡ง๐Ÿ‡ฎ Burundi +257
//๐Ÿ‡ง๐Ÿ‡ฏ Benin +229
//๐Ÿ‡ง๐Ÿ‡ฑ Saint Barthรฉlemy +590
//๐Ÿ‡ง๐Ÿ‡ฒ Bermuda +1441
//๐Ÿ‡ง๐Ÿ‡ณ Brunei +673
//๐Ÿ‡ง๐Ÿ‡ด Bolivia +591
//๐Ÿ‡ง๐Ÿ‡ถ Bonaire +5997
//๐Ÿ‡ง๐Ÿ‡ท Brazil +55
//๐Ÿ‡ง๐Ÿ‡ธ Bahamas +1242
//๐Ÿ‡ง๐Ÿ‡น Bhutan +975
//๐Ÿ‡ง๐Ÿ‡ป Bouvet Island +47
//๐Ÿ‡ง๐Ÿ‡ผ Botswana +267
//๐Ÿ‡ง๐Ÿ‡พ Belarus +375
//๐Ÿ‡ง๐Ÿ‡ฟ Belize +501
//๐Ÿ‡จ๐Ÿ‡ฆ Canada +1
//.......

Why?

I didn't want to use libs just to show country flags.