views:

383

answers:

1

There is a similar question to this but answer is very general, vague.(http://stackoverflow.com/questions/1587855/detecting-uitableview-scrolling) Please don't dismiss. I am looking for concrete solution.

I have UITableView which has editable textfield and PickerView appears when another cell selected. What I need is to hide firstResponder or PickerView when user starts scrolling this UITableView.

So far in question http://stackoverflow.com/questions/1587855/detecting-uitableview-scrolling there's a sugestion that you should subclass UITableView. IF you subsclass UITableView still internal/private UIScrollView is not accessible. How do I access UITableView's parent ScrollView (without breaking the law)?

Thanks.

+2  A: 

You don't need to subclass UITableView to track scrolling. Your UITableViewDelegate can serve as UIScrollViewDelegate as well. So in your delegate class you can implement -scrollViewWillBeginDragging: or whatever UIScrollViewDelegate method you need in your situation. (as actually suggested in the question you mention)

Vladimir
Thanks, I got it. jus tneed to add <UIScrollViewDelegate> to@interface MyTableViewController : UIViewController <UIScrollViewDelegate>and then implement -scrollViewWillBeginDragging:Thanks.
Rod