Is there a way in iOS to know if a UICollectionView is scrolling or not?
I want to know it because I'm loading in every UICollectionCell an image downloaded from the Web, but if the Collection View is big and I scroll until the end it starts downloading every image and if I change view I must wait that previous download, this slow down the app and is not cool, lol :D
Thanks and sorry for my English ;)
As the previous post mentions, UICollectionView
inherits from UIScrollView
, so I think you can just check a couple UIScrollView
methods:
BOOL isScrolling = (cv.isDragging || cv.isDecelerating);
Edit: As the comment have mentioned, the API is now:
BOOL isScrolling = (cv.dragging || cv.decelerating);
For Swift
let isScrolling: Bool = colView.isDragging || colView.isDecelerating
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