Search code examples
iosobjective-ckeyboarduitextfielduipickerview

How to replace UIPickerView with native keyboard back?


I need to dynamically change the input for UITextField: keyboard with pickerView and back (pickerView with keyboard).

I know how to substitute keyboard with pickerView - via input property of textfield.

But I don't know to substitute pickerView with keyboard back. How can I do this?

The flow is following:

  • user need to enter some value into textfield (typing via keyboard)
  • then I'll show them some clarification options via pickerView, user select any option and it will appear into textfield
  • then user should be able to edit the selected value in the textfield via native keyboard

Thank you


Solution

  • You can use,

    textfield.inputView = nil;
    

    and if you want to show keyboard directly after then you can use

    [textfield becomeFirstResponder];
    

    Hope this will work. :)