Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect which UITableView is scrolling

Im detecting UITableView scrolling in this way

`

  - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate: (BOOL)decelerate{
isDragging_msg = FALSE;
[tblSongs reloadData];

}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
isDecliring_msg = FALSE;
[tblSongs reloadData]; }


- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{
isDragging_msg = TRUE;

}

 - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{
isDecliring_msg = TRUE; }

`

but I have to load sevaral UITableViews Under this detection I have to reload each tables seperately. So how I can detect which table is currently scrolling.

Thanks

like image 707
iDia Avatar asked May 29 '13 07:05

iDia


Video Answer


1 Answers

Table view is a scroll view as mentioned here: Is it possible to access a UITableView's ScrollView In Code From A Nib?

So you can just check the scroll view passed in each delegate method whether the scroll view is the table view you want, for example:

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{
    if (scrollView == tblSongs) {
        isDragging_msg = FALSE;
        [tblSongs reloadData];
    }
}
like image 142
Valent Richie Avatar answered Nov 13 '22 10:11

Valent Richie