Closed fareast555 closed 4 years ago
Hello @fareast555 ! Thank you so much for raising this issue and pasting all the evidence! I would like you to try the latest version of the pod (3.1.1) which was completely re-written to use custom collection view layouts, which might solve this issue. Unfortunately, I'm not supporting v2 anymore because it was painful in the end to try to customize it. All details related to the setup of this pod are in the Readme, and feel free to ask me anything if something is unclear or not working!
Have a great day!
Hi @MaherKSantina . Thanks for the reply. One guy in our team had a pull request in updating to 3.1.1, thought it was already in, but it's still under review. Once it gets in I'll run some tests and update you.
Actually, there are two issues, both which will hopefully disappear. The first is as reported here. The second, which I assumed might be related to this one -- which seems like a race time issue -- is that there are occasions where the collection view sends back the active index of the cell before the last cell, but shows the last cell in the array. As with the issue reported here, you have to really try a bunch of times quickly to go over index to get it to do it.
Anyway, for now, I'll close off this issue if that's OK. If I see it in the 3.1.1 I'll open up a new issue. Thanks for making this insanely useful implementation. Getting collection views to work as expected is a pain, so this is really a great bit of software.
And...as a PS. I'm digging into the latest code. Is there no longer any callback for an active Index?
@fareast555 thank you soo much for your kind words! 🙏 Yeah I agree working with collection views is sometimes hard!
Is there no longer any callback for an active Index?
There is one that gives you the current index when the user scrolls to a new cell, you just have to conform to UICollectionViewDelegate
and implement scrollViewDidEndDecelerating
function. The code to do that is also available in the demo project, I'll write it here:
extension ViewController: UICollectionViewDelegate {
...
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
print(behavior.currentIndex)
}
}
Please let me know if that works 👍
I'll give it a try. Cheers!
MSPeekImplementationDelegate method:
Returns -1 if continuous fast swipe attempts made to go below the first cell...
or returns dataSource.count if trying to swipe beyond max cell.
This only happens when I really push it and swipe super fast.
Device: iPhone SE running 13.3.1 Xcode 11.3.1 Installed via cocoapods