Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scrollViewDidEndDecelerating detect which collection view in action

I use this method to organize paging:

- scrollViewDidEndDecelerating

When I scroll my UICollectionView I change some content on my screen. But I have few UICollectionView on my screen and I need it just for one.

like image 535
Matrosov Oleksandr Avatar asked Nov 22 '13 16:11

Matrosov Oleksandr


1 Answers

Well, UICollectionView inherits from UIScrollView, so you could just check which scroll view did end decelerating from within the delegate method.

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    if (scrollView == collectionViewOne) {

    }else if (scrollView == collectionViewTwo) {

    }else{
            //something else
    }
}
like image 135
Mick MacCallum Avatar answered Oct 17 '22 10:10

Mick MacCallum