Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIPickerView: Get row value while spinning?

I'd like to get the row value in real-time as the iPhone user spins a wheel in a UIPickerView (not just when the wheel settles onto a particular row). I looked into subclassing UIPickerView then overriding the mouseDown method, but I couldn't get this to work. Any suggestions would be very much appreciated.

like image 534
user183266 Avatar asked Oct 02 '09 18:10

user183266


1 Answers

Perhaps try implementing the delegate method:

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view

You could treat it as a passthrough (just passing back the reusingView parameter) but each time it was called you would know that view was coming on the screen as the user scrolled - then you could calculate how many views offset from this one the center view was.

like image 171
Kendall Helmstetter Gelner Avatar answered Nov 17 '22 06:11

Kendall Helmstetter Gelner