BBTextFieldPicker is a UITextField replacement that swaps out the keyboard for a UIPickerView.
Add pod 'BBTextFieldPicker'
to your Podfile
Copy the BBTextFieldPicker.h/m
files to your project.
Just use BBTextFieldPicker as a replacement for UITextField.
BBTextFieldPicker *textField = [[BBTextFieldPicker alloc] init];
textField.placeholder = @"Placeholder text";
textField.pickerDataSource = someArray;
textField.toolbarButton.title = @"Next";
textField.textFieldPickerDelegate = self;
You can also swap out the class type in Interface Builder if you want. Just add a normal UITextField and change the class type to BBTextFieldPicker.
- (void)pickerToolbarButtonPressed:(id)sender;
The toolbar button can be used to navigate to the next text field (if used in a form) or to just dismiss the picker. Implementation is up to the user.