The UIPickerView
class has a method selectedRowInComponent
that returns the selected row for the component. That may or may not be the item that is in the center of the picker view. What I'd like is to be able to tell what index of the pickerView data is currently being displayed (not selected).
To illustrate the difference, if you tap a value in the UIPickerView dial, the row for that value seems to always be returned in selectedRowInComponent
. However, if the user scrolls the picker through several values and then lifts the finger, selectedRowInComponent
is not updated, or it is updated to the value that just scrolled off.
Is there anyway to determine where the picker component is actually dialed?
The value is always available in method pickerView:didSelectRow:inComponent:
but I would like to query it in method pickerView:titleForRow:forComponent:
Why? Because while the UIPickerView is being scrolled selectedRowInComponent
is not being called. If for some reason I get to the end of the data and need to add more, I need to do it in a method that is being called. That would seem to be pickerView:titleForRow:forComponent:
, which is called for every row.