I think the title explains it all. I want to be notified when a user scrolls to the top of a tableview.
I've tried the following with no luck and even added a UIScrollViewDelegate to the .h file.
- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView{
NSLog(@"ScrolledToTop");
}
Thanks!
Edit: I can get it to call if I press the status bar. But not if I scroll to the top. Weird... could it have something to do with the tableview bouncing when it reaches the top?
What happens if you try this?
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView.contentOffset.y == 0)
NSLog(@"At the top");
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0 && indexPath.section == 0 ) {
NSLog(@"Showing top cell");
}
Is that close enough?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With