diff --git a/DraggableCollectionView/Helpers/LSCollectionViewHelper.m b/DraggableCollectionView/Helpers/LSCollectionViewHelper.m index 77929f6..d666d05 100644 --- a/DraggableCollectionView/Helpers/LSCollectionViewHelper.m +++ b/DraggableCollectionView/Helpers/LSCollectionViewHelper.m @@ -271,9 +271,6 @@ - (void)handleLongPressGesture:(UILongPressGestureRecognizer *)sender self.layoutHelper.toIndexPath = nil; } completion:^(BOOL finished) { if (finished) { - if ([dataSource respondsToSelector:@selector(collectionView:didMoveItemAtIndexPath:toIndexPath:)]) { - [dataSource collectionView:self.collectionView didMoveItemAtIndexPath:fromIndexPath toIndexPath:toIndexPath]; - } } }]; @@ -290,6 +287,12 @@ - (void)handleLongPressGesture:(UILongPressGestureRecognizer *)sender mockCell = nil; self.layoutHelper.hideIndexPath = nil; [self.collectionView.collectionViewLayout invalidateLayout]; + + if ([dataSource respondsToSelector:@selector(collectionView:didMoveItemAtIndexPath:toIndexPath:)]) { + [dataSource collectionView:self.collectionView didMoveItemAtIndexPath:fromIndexPath toIndexPath:toIndexPath]; + }else{ + [self.collectionView reloadData]; + } }]; // Reset