I\'m looking for a way to present a UIPickerView
when the user taps on a UIBarButtonItem
. Imagine a filter for the table view results.
I know I
A better option is still to use the UITextField
. You don't have to actually show it on screen. Just put it in a 0x0 UIView
so that it is not visible, set it's inputView
to your UIPickerView
and call becomeFirstResponder
on it to show the picker and resignFirstResponder
to hide it.
It is convenient to have a UIView
subclass that implements all of that along with UIPickerViewDelegate
and UIPickerViewDataSource
methods.