You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And after implementing this code below, it returns proper IndexPath.
// Issue NOT visible here, the indexPath.item IS correct
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
for cell in collectionView.visibleCells {
let indexPath = collectionView.indexPath(for: cell)
print(indexPath?.item)
return
}
}
Not sure if this is up to your library but I'll try nevertheless.
I'm using CardsCollectionViewLayout in my code via Swift Bridging for my CollectionView.
Objective-C (Not Working)
My issue is that
IndexPath
is returning wrong Item index. Here is the minimal code:Result (notice how both 1st and 2nd cell has same IndexPath Item):
Swift (Working)
I tried your Example from this code Repository, which has declared colors statically:
And after implementing this code below, it returns proper IndexPath.
Result:
What am I doing wrong in my
Objective-C
code?Things I've tried
The text was updated successfully, but these errors were encountered: