From a4f02dbfd0e7652c4593821a7bb1c82c02b02436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20C=C5=93ur?= Date: Mon, 8 May 2017 17:03:21 +0800 Subject: [PATCH] Update UICollectionViewRightAlignedLayout.m similar fix as https://github.com/mokagio/UICollectionViewLeftAlignedLayout/commit/b33d93bb17832c51ce4a06b69a0d98baac567de5 --- .../UICollectionViewRightAlignedLayout.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UICollectionViewRightAlignedLayout/UICollectionViewRightAlignedLayout.m b/UICollectionViewRightAlignedLayout/UICollectionViewRightAlignedLayout.m index fa3e481..2508cc0 100644 --- a/UICollectionViewRightAlignedLayout/UICollectionViewRightAlignedLayout.m +++ b/UICollectionViewRightAlignedLayout/UICollectionViewRightAlignedLayout.m @@ -73,7 +73,7 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde self.collectionView.frame.size.width, currentFrame.size.height); // if the current frame, once left aligned to the left and stretched to the full collection view - // widht intersects the previous frame then they are on the same line + // width intersects the previous frame then they are on the same line BOOL isFirstItemInRow = !CGRectIntersectsRect(previousFrame, strecthedCurrentFrame); if (isFirstItemInRow) { @@ -83,7 +83,7 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde CGFloat previousFrameLeftPoint = previousFrame.origin.x; CGRect frame = currentItemAttributes.frame; - CGFloat minimumInteritemSpacing = [self evaluatedMinimumInteritemSpacingForItemAtIndex:indexPath.row]; + CGFloat minimumInteritemSpacing = [self evaluatedMinimumInteritemSpacingForItemAtIndex:indexPath.section]; frame.origin.x = previousFrameLeftPoint - minimumInteritemSpacing - frame.size.width; currentItemAttributes.frame = frame; return currentItemAttributes;