Skip to content

Commit 9318ef3

Browse files
authored
Merge pull request #110 from AntiMoron/master
Bugfix: Incorrect begin indexpath
2 parents 58b772e + c49619e commit 9318ef3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ - (void)handleLongPressGesture:(UILongPressGestureRecognizer *)gestureRecognizer
331331

332332
self.currentViewCenter = self.currentView.center;
333333

334+
if ([self.delegate respondsToSelector:@selector(collectionView:layout:didBeginDraggingItemAtIndexPath:)]) {
335+
[self.delegate collectionView:strongSelf.collectionView layout:self didBeginDraggingItemAtIndexPath:self.selectedItemIndexPath];
336+
}
337+
334338
__weak typeof(self) weakSelf = self;
335339
[UIView
336340
animateWithDuration:0.3
@@ -348,10 +352,6 @@ - (void)handleLongPressGesture:(UILongPressGestureRecognizer *)gestureRecognizer
348352
__strong typeof(self) strongSelf = weakSelf;
349353
if (strongSelf) {
350354
[highlightedImageView removeFromSuperview];
351-
352-
if ([strongSelf.delegate respondsToSelector:@selector(collectionView:layout:didBeginDraggingItemAtIndexPath:)]) {
353-
[strongSelf.delegate collectionView:strongSelf.collectionView layout:strongSelf didBeginDraggingItemAtIndexPath:strongSelf.selectedItemIndexPath];
354-
}
355355
}
356356
}];
357357

0 commit comments

Comments
 (0)