Latest 1.0.4
Homepage https://github.com/abdulshamim/ALCountryPicker
License MIT
Platforms ios 10.0
Authors

CI Status
Version
License
Platform

Country Picker

List of all countries with flag and dialling code. You serach country by name, region code and dialling code.
You can get you current country without opening country picker. For flag Emoji Unicode.Scalar is used.

Requirements

  • iOS 10.0+
  • Xcode 9+
  • Swift 4+

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

ALCountryPicker is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'ALCountryPicker'

Getting Started

import UIKit
import ALCountryPicker

class ViewController: UIViewController {

    @IBOutlet weak var countryLabel: UILabel!

    override func viewDidLoad() {
        super.viewDidLoad()

        if let currentCountry = Country.current {
            self.countryLabel.text = currentCountry.flag + " " + currentCountry.countryName +  " ((String(describing: currentCountry.dialingCode ?? "")))"
        }

    }

    @IBAction func openCountry(_ sender: UIButton) {
        CountryPicker.present(on: self) { (country) in
            DispatchQueue.main.async {
                print(country.dialingCode ?? "")
                print(country.flag, "",country.countryName, "", country.countryCode)
                self.countryLabel.text = country.flag + " " + country.countryName +  " ((String(describing: country.dialingCode ?? "")))"
            }
        }
    }

}

Gif

countrypicker

ScreenShots

img1 img2

You can search country by Dialling Code, Region Code and Country Name.

img4 img5 img3

Author

Abdul Shamim Khan
[email protected]

License

ALCountryPicker is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ALCountryPicker",
    "version": "1.0.4",
    "summary": "This is country picker framework.",
    "description": "List of all countries. You can search your country via name, country code and dialing code.",
    "homepage": "https://github.com/abdulshamim/ALCountryPicker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Abdul": "[email protected]"
    },
    "source": {
        "git": "https://github.com/abdulshamim/ALCountryPicker.git",
        "tag": "1.0.4"
    },
    "platforms": {
        "ios": "10.0"
    },
    "swift_version": "4.1",
    "source_files": "Files/**/*.{swift}",
    "resource_bundles": {
        "ALCountryPicker": [
            "Views/**/*.{storyboard,xib}"
        ]
    }
}

Pin It on Pinterest

Share This