Skip to content
MICountryPicker is a country picker controller for iOS8+ with an option to search.
Swift Ruby
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
MICountryPicker.xcodeproj -- update podspec Oct 28, 2016
MICountryPicker -- Swift 3 Sep 19, 2016
MICountryPickerTests -- Swift 3 Sep 19, 2016
Source -- fix plist loading Nov 11, 2016
.gitignore ignore userstate file Jun 18, 2016
LICENSE License added Jan 24, 2016
MICountryPicker.podspec -- update podspec Nov 11, 2016
README.md
screen1.png screenshots added Jan 24, 2016
screen2.png screenshots added Jan 24, 2016
screen3.png adds new screen shot Jun 24, 2016

README.md

MICountryPicker

MICountryPicker is a country picker controller for iOS8+ with an option to search. The list of countries is based on the ISO 3166 country code standard (http://en.wikipedia.org/wiki/ISO_3166-1). Also and the library includes a set of 250 public domain flag images from https://github.com/pradyumnad/Country-List.

Screenshots

alt tag alt tag alt tag

Installation

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

# Swift 3
use_frameworks!
pod 'MICountryPicker', :git => 'https://github.com/mustafaibrahim989/MICountryPicker.git', :branch => 'master'

# Swift 2
use_frameworks!
pod 'MICountryPicker', :git => 'https://github.com/mustafaibrahim989/MICountryPicker.git', :branch => 'swift-2'

Show MICountryPicker from UIViewController

let picker = MICountryPicker()
navigationController?.pushViewController(picker, animated: true)

MICountryPickerDelegate protocol

// delegate
picker.delegate = self

// Optionally, set this to display the country calling codes after the names
picker.showCallingCodes = true
func countryPicker(picker: MICountryPicker, didSelectCountryWithName name: String, code: String) {
        print(code)
}

func countryPicker(picker: MICountryPicker, didSelectCountryWithName name: String, code: String, dialCode: String) {
        print(dialCode)
}

Closure

// or closure
picker.didSelectCountryClosure = { name, code in
        print(code)
}

picker.didSelectCountryWithCallingCodeClosure = { name, code, dialCode in
        print(dialCode)
}

Author

Mustafa Ibrahim, mustafa.ibrahim989@gmail.com

Notes

Designed for iOS 8+.

License

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

You can’t perform that action at this time.