https://github.com/levantaj/countrysource
List of all countries in the world (name, code, phone code)
https://github.com/levantaj/countrysource
country country-codes countrycode current dialcodes phone phonenumber
Last synced: 8 months ago
JSON representation
List of all countries in the world (name, code, phone code)
- Host: GitHub
- URL: https://github.com/levantaj/countrysource
- Owner: levantAJ
- License: mit
- Created: 2020-10-18T02:05:58.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-08T03:21:26.000Z (over 5 years ago)
- Last Synced: 2025-04-19T22:12:38.570Z (10 months ago)
- Topics: country, country-codes, countrycode, current, dialcodes, phone, phonenumber
- Language: Swift
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://cocoadocs.org/docsets/CountrySource/)
[](http://cocoadocs.org/docsets/CountrySource/)
[](https://www.apache.org/licenses/LICENSE-2.0.html)
# CountrySource
Provides list of all countries in the world (name, code, phone code) & determine current country.

## Requirements
- iOS 9.0 or later
- Xcode 11.0 or later
## Install
### Installation with CocoaPods
```ruby
pod 'CountrySource', '1.2'
```
### Build Project
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.
## How to use:
```swift
import CountrySource
```
#### Get current country:
```swift
CountrySource().currentCountry { result in
switch result {
case .success(let country):
print(country.code, country.name, country.dialCode)
case .failure(let error):
print(error)
}
```
#### Get all countries
```swift
CountrySource().allCountries { result in
switch result {
case .success(let countries):
print(countries)
case .failure(let error):
print(error)
}
}
```
## Author
- [Tai Le](https://github.com/levantAJ)
## Communication
- 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.
## Licenses
All source code is licensed under the [MIT License](https://raw.githubusercontent.com/levantAJ/CountrySource/master/LICENSE).