For deleting cell you should use
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleDelete;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
NSUserDefaults *usd = [NSUserDefaults standardUserDefaults];
[usd removeObjectForKey:@"payViaCreditCard"];
selectedCardID = nil;
[[CreditCardManager sharedCreditCardManager] removeCreditCard:creditCardToDelete];
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
//[self.tableView reloadData];
}
}
If you don't want to allow deleting, just reordering, then there is no need to do anything about indenting. Instead, just do:
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleNone;
}
And don't implement the `tableView:commitEditingStyle:forRowAtIndexPath:` method at all.
You also avoid returning `deleteAction` from `tableView:editActionsForRowAtIndexPath:`.
That will prevent row deletion. You can now support reordering as needed.