arnauddorgans / InfiniteLayout

Horizontal and Vertical infinite scrolling feature for UICollectionView with Paging, NSProxy delegate, Reactive extension, SectionModel & AnimatableSectionModel support
MIT License
516 stars 63 forks source link

Different cell returned based on centered indexPath return on infiniteCollectionView(_ infiniteCollectionView: InfiniteCollectionView, didChangeCenteredIndexPath centeredIndexPath: IndexPath? #10

Open jijijrey opened 5 years ago

jijijrey commented 5 years ago

i want to edit the cell contents once they are scroll to the center but when I dequeue cell from the given centeredIndexPath from delegate func

func infiniteCollectionView(_ infiniteCollectionView: InfiniteCollectionView, didChangeCenteredIndexPath centeredIndexPath: IndexPath?)

i will get the wrong cell.

How can I get the correct centered cell from the given centeredIndexPath in the delegate? Thanks

arnauddorgans commented 5 years ago

Hi, sorry i'm late

Are you using self.infiniteCollectionView.indexPath(from: indexPath) ?