Provides list of all countries in the world (name, code, phone code) & determine current country.
- iOS 9.0 or later
- Xcode 11.0 or later
pod 'CountrySource', '1.2'
At this point your workspace should build without error. If you are having problem, post to the Issue and the community can help you solve it.
import CountrySource
CountrySource().currentCountry { result in
switch result {
case .success(let country):
print(country.code, country.name, country.dialCode)
case .failure(let error):
print(error)
}
CountrySource().allCountries { result in
switch result {
case .success(let countries):
print(countries)
case .failure(let error):
print(error)
}
}
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
All source code is licensed under the MIT License.