14

I am looking to allow reordering of UITableViewCells and deleting via swipe to delete, but not via the red delete circle.

- (void)loadView
{
    [super loadView];
    [table setEditing:YES animated:NO];
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Perform delete here
    }
}

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
    // Perform move here
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewCellEditingStyleDelete;
}

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    return YES;
}

Additionally, I've tried disabling the edit mode and calling -[UITableViewCell setShowsReorderControl:YES] with no luck.

Image
(source: booleanmagic.com)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
rpetrich
  • 32,196
  • 6
  • 66
  • 89
  • Yes, I'm aware. The "link account" feature didn't work. Path of least resistance was to just create a new account and orphan the temporary one. – rpetrich Sep 04 '12 at 01:18

1 Answers1

2

I think you'll have to do some custom touch event interception.

In english: if finger moved, x distance, horizontally across cell, in that cell only, then show delete control.

Not sure how to turn off the circles to the left, but I do think it's a property like "shows reorder control"

fearmint
  • 5,276
  • 2
  • 33
  • 45
  • Unfortunately, there appears to be no way to show the delete confirmation programatically (showingDeleteConfirmation is readonly). For now I'm leaving the the reorder control visible, but will probably end up intercepting the touches and showing a custom delete button manually. – rpetrich Oct 26 '09 at 15:43