MaherKSantina / MSPeekCollectionViewDelegateImplementation

A custom paging behavior that peeks the previous and next items in a collection view
https://medium.com/@maher.santina90/how-to-create-cells-that-peek-on-the-sides-like-ios-11-app-store-ef4bb54c0c7d
MIT License
356 stars 32 forks source link

Backward scroll #74

Open Serg-Pogrebnyak opened 3 years ago

Serg-Pogrebnyak commented 3 years ago

Please fix backward scroll... because if I want make backward scroll for example on 2-3 cell I can do this only on one cell, I made small research and found problem in MSCollectionViewPaging.swift in func getNewTargetOffset(startingOffset: CGFloat, velocity: CGFloat, targetOffset: CGFloat) -> CGFloat if I change var offset = max(targetIndex - currentIndex, 1) on var offset = max(abs(targetIndex - currentIndex), 1) all work correctly, please, check this. Thanks a lot)