KelvinJin / AnimatedCollectionViewLayout

A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView without effecting your existing code.
MIT License
4.7k stars 347 forks source link

fast scrolling? (enhancement) #40

Open gloparco opened 6 years ago

gloparco commented 6 years ago

Where would I alter the code to allow fast scrolling? By fast scrolling, I am referring to the fact that the current animations allow "one cell at a time" scrolling, rather than the typical UIScrollView scrolling.

In particular, what I think would be useful would be to allow for fast scrolling and then upon stopping (either manually, or once the animation finishes), snapping to the closest cell.

I know the author of this is busy, but if someone could point me in the right direction, perhaps I can create a pull request and work on it myself.

KelvinJin commented 6 years ago

Hi! The 'pagingEnabled' property of the UICollectionView is true by recommendation, but you can definitely turn it off so you have the normal behaviour. For snapping, you can definitely override the AnimatrdCollectionViewLayout and implement the targetContentOffset method. You can find some examples on GitHub too. Overriding might not be possible, but feel free to copy the code or submit a PR!