/CSPickerTextField

A simple UITextField class extension with single-component picker as input.

Primary LanguageObjective-C

CSPickerTextField

A simple UITextField extension that creates a single-component UIPickerView as input.

alt tag

How to Use

_1. Copy and paste CSPickerTextField.h, CSPickerTextField.m, and CSPickerTextFieldDelegate.h from the CSPickerTextField folder into your project.

For Swift, add these in the bridging-header too: alt tag

_2. Create a UITextField in storyboard and make its class CSPickerTextField.

_3. Make your view controller conforms to CSPickerTextFieldDelegate, set your_text_field.pickerDelegate = self, and implements the delegate methods.

Objective-C
ViewController.h

alt tag

ViewController.m

alt tag

Swift
ViewController.swift

alt tag

There you go, happy coding!