Latest 1.0.1
Homepage https://github.com/samuelbeek/SwiftCountryPicker
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit
Authors

Image

[![CI Status](http://img.shields.io/travis/Samuel Beek/SwiftCountryPicker.svg?style=flat)](https://travis-ci.org/Samuel Beek/SwiftCountryPicker)
Version
License
Platform

Usage

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

For the most clear example, checkout the example project

Create a new CountryPicker

let countryPicker = CountryPicker(frame: CGRectMake(0,0,self.view.frame.size.width, 216))
countryPicker.countryDelegate = self

To retreive the picked country the ViewController must conform with the CountryPickerDelegate, do that by adding the following snippet at the bottom of your file:

func countryPicker(picker: CountryPicker, didSelectCountry country: Country) {
    // do whatever you want with the picked Counrty
}

To add the CountryPicker as inputView for a textField:

textField = UITextField(frame: CGRectMake(0,0,40,30))
textField.inputView = countryPicker
view.addSubview(textField)

Requirements

iOS 9 or higher

Installation

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

pod "SwiftCountryPicker"

or install it with Carthage

github "samuelbeek/SwiftCountryPicker"

Add the following line to the top of the file you want to use the CountryPicker in:

import SwiftCountryPicker 

Author

Samuel Beek, [email protected], twitter

License

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

Latest podspec

{
    "name": "SwiftCountryPicker",
    "version": "1.0.1",
    "summary": "A country picker that uses EMOJI as flags in Swift.",
    "description": "A very simple CountryPicker in Swift, which is super easy to implement. It uses emoji as flags, so it's size is as low as possible. When a user has selected a country you can retreieve it's name and flag, but most importantly: it's ISO code. It's a subclass UIPickerView that displays country names and flags in a slot machine interface. Customization is very easy, because it's a UIPickerView suvlcass.ndescription",
    "homepage": "https://github.com/samuelbeek/SwiftCountryPicker",
    "screenshots": "http://i.imgur.com/ZGjTtoX.png",
    "license": "MIT",
    "authors": {
        "Samuel Beek": "[email protected]"
    },
    "source": {
        "git": "https://github.com/samuelbeek/SwiftCountryPicker.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "SwiftCountryPicker": [
            "Pod/Assets/*.json"
        ]
    },
    "frameworks": "UIKit",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This