Greetings. Following- up on the question above...
I am looking for a way to grab the scroll position after each time a user scrolls a table view. I came across the scrollViewDidEndScrollingAnimation, which I believe may do the trick. It appears to be a UIScrollViewDelegate method, however, and I have been unable to figure out how to have it called when using a Table View (which I think is what is suggested by Ben Gottlieb).
Any chance someone could help me understand how to make this work or point to sample code?
Many thanks.
2 hours later...
Not sure if the is the right way to do it, but I've got it working and thought I would post back here 1) in case others are searching on this and 2) in case there is a better way of doing this that others can point me toward.
Turned out to be quite simple. In the interface declaration, I added the UIScrollViewDelegate protocol like so:
@interface ListViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate> { ... }
Then added the appropriate delegate methods in the .m file like this:
- (void)scrollViewDidEndDragging:(UIScrollView *)sender willDecelerate:(BOOL)decelerate { do something; }
I was originally getting hung-up on only having a tableView defined and not something called a scollView, but I guess the delegate calls trickle down because tableView is a subclass of scrollView?
I've tried several of the methods in the ScrollViewDelegate Protocol, and it seems like most are being called with this (but not scrollViewDidEndScrollingAnimation?).