Skip to content

Commit

Permalink
fixes do not remove cell when the delete button tapped
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Lavlinskyi authored and Dmitry Lavlinskyi committed Mar 13, 2015
1 parent 66bd852 commit 374ad70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions RETableViewManager/RETableViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
RETableViewItem *item = [section.items objectAtIndex:indexPath.row];
if (item.deletionHandlerWithCompletion) {
item.deletionHandlerWithCompletion(item, ^{
[section removeItemAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
// [section removeItemAtIndex:indexPath.row];
// [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];

for (NSInteger i = indexPath.row; i < section.items.count; i++) {
RETableViewItem *afterItem = [[section items] objectAtIndex:i];
Expand All @@ -332,8 +332,8 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
} else {
if (item.deletionHandler)
item.deletionHandler(item);
[section removeItemAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
// [section removeItemAtIndex:indexPath.row];
// [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];

for (NSInteger i = indexPath.row; i < section.items.count; i++) {
RETableViewItem *afterItem = [[section items] objectAtIndex:i];
Expand Down

0 comments on commit 374ad70

Please sign in to comment.