Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

reloading cells fix #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions DraggableCollectionView/Helpers/LSCollectionViewHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
}];

Expand All @@ -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
Expand Down