@@ -72,7 +72,7 @@ private extension InfiniteCollectionView {
7272 }
7373 let centerPoint = CGPoint ( x: scrollView. frame. size. width / 2 + scrollView. contentOffset. x, y: scrollView. frame. size. height / 2 + scrollView. contentOffset. y)
7474 guard let indexPath = indexPathForItemAtPoint ( centerPoint) else { return }
75- infiniteDelegate? . didUpdatePageIndex ? ( correctedIndex ( indexPath. row - indexOffset) )
75+ infiniteDelegate? . didUpdatePageIndex ? ( correctedIndex ( indexPath. item - indexOffset) )
7676 }
7777 func shiftContentArray( offset: Int ) {
7878 indexOffset += offset
@@ -105,7 +105,7 @@ extension InfiniteCollectionView: UICollectionViewDataSource {
105105 }
106106 public func collectionView( collectionView: UICollectionView , cellForItemAtIndexPath indexPath: NSIndexPath ) -> UICollectionViewCell {
107107 var maybeCell : UICollectionViewCell !
108- maybeCell = infiniteDataSource? . cellForItemAtIndexPath ( self , dequeueIndexPath: indexPath, indexPath: NSIndexPath ( forRow: correctedIndex ( indexPath. row - indexOffset) , inSection: 0 ) )
108+ maybeCell = infiniteDataSource? . cellForItemAtIndexPath ( self , dequeueIndexPath: indexPath, indexPath: NSIndexPath ( forRow: correctedIndex ( indexPath. item - indexOffset) , inSection: 0 ) )
109109 if maybeCell == nil {
110110 maybeCell = collectionView. dequeueReusableCellWithReuseIdentifier ( Me . defaultIdentifier, forIndexPath: indexPath)
111111 }
@@ -116,7 +116,7 @@ extension InfiniteCollectionView: UICollectionViewDataSource {
116116// MARK: - UICollectionViewDelegate
117117extension InfiniteCollectionView : UICollectionViewDelegate {
118118 public func collectionView( collectionView: UICollectionView , didSelectItemAtIndexPath indexPath: NSIndexPath ) {
119- infiniteDelegate? . didSelectCellAtIndexPath ? ( self , indexPath: NSIndexPath ( forRow: correctedIndex ( indexPath. row - indexOffset) , inSection: 0 ) )
119+ infiniteDelegate? . didSelectCellAtIndexPath ? ( self , indexPath: NSIndexPath ( forRow: correctedIndex ( indexPath. item - indexOffset) , inSection: 0 ) )
120120 }
121121 public func scrollViewDidScroll( scrollView: UIScrollView ) {
122122 centerIfNeeded ( scrollView)
0 commit comments