levantAJ / CountrySource

List of all countries in the world (name, code, phone code)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pod Version Pod Platform Pod License

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

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:

import CountrySource

Get current country:

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

CountrySource().allCountries { result in
    switch result {
    case .success(let countries):
        print(countries)
    case .failure(let error):
        print(error)            
    }
}

Author

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.

About

List of all countries in the world (name, code, phone code)

License:MIT License


Languages

Language:Swift 71.4%Language:Ruby 17.0%Language:Objective-C 11.6%