Skip to content

Commit 28c7223

Browse files
committed
Small changed
1 parent 6f73cf4 commit 28c7223

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Example/Example/ImageCollectionViewCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class ImageCollectionViewCell: UICollectionViewCell {
1313
static let identifier = "ImageCollectionViewCell"
1414
static let nib = UINib(nibName: "ImageCollectionViewCell", bundle: nil)
1515
func configure(dequeueIndexPath dequeueIndexPath: NSIndexPath) {
16-
let image = UIImage(named: String(dequeueIndexPath.row))
16+
let image = UIImage(named: String(dequeueIndexPath.item))
1717
imageView.image = image
1818
setNeedsLayout()
1919
layoutIfNeeded()

InfiniteCollectionView/InfiniteCollectionView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
117117
extension 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

Comments
 (0)