How to detect scrolling of UITableView?

Viewed 28097

There is a similar question to this but answer is very general, vague.( 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 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.

4 Answers

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)

Related