Skip to content
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
5 changes: 5 additions & 0 deletions BVReorderTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ - (void)updateCurrentLocation:(UILongPressGestureRecognizer *)gesture {
NSInteger newHeight = [self rectForRowAtIndexPath:indexPath].size.height;

if (indexPath && ![indexPath isEqual:self.currentLocationIndexPath] && [gesture locationInView:[self cellForRowAtIndexPath:indexPath]].y > newHeight - oldHeight) {
if ([self.dataSource respondsToSelector:@selector(tableView:canMoveRowAtIndexPath:)]) {
if (![self.dataSource tableView:self canMoveRowAtIndexPath:indexPath]) {
return;
}
}
[self beginUpdates];
[self deleteRowsAtIndexPaths:[NSArray arrayWithObject:self.currentLocationIndexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
[self insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
Expand Down