Giter Site home page Giter Site logo

tin612 / micountrypicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mustafaibrahim989/micountrypicker

0.0 2.0 0.0 573 KB

MICountryPicker is a country picker controller for iOS8+ with an option to search.

License: MIT License

Ruby 5.34% Swift 94.66%

micountrypicker's Introduction

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, [email protected]

Notes

Designed for iOS 8+.

License

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

micountrypicker's People

Contributors

mustafaibrahim989 avatar phowat avatar hemant3370 avatar lfarah avatar

Watchers

James Cloos avatar Phan Thanh Tín avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.