6

My question is like this: Reordering UITableView without reorder control, I use these methods:

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewCellEditingStyleNone;
}
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
    return NO;
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath{

}

And

[self.tableView setEditing:YES];

......

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    ItemTableViewCell *cell = (ItemTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ItemTableViewCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }
    // ...
    cell.showsReorderControl = NO;
    return cell;
}

References: reordering control in UITableView

The result is that the table can be reordered, but the reorder control never hide. So I wonder if I am wrong, or if anybody can help me? Thank you.

Community
  • 1
  • 1
Smeegol
  • 2,014
  • 4
  • 29
  • 44

1 Answers1

4

Check This URL:Reordering a UITableViewCell from any Touch point.This might be helpful to you

Munim
  • 2,626
  • 1
  • 19
  • 28
iosdev1111
  • 1,048
  • 1
  • 13
  • 32
  • 1
    Can I suggest trying [BVReorderTableView](https://github.com/bvogelzang/BVReorderTableView)? Instead of hacking UITableView cell subviews it offers a bit cleaner solution. – bvogelzang Mar 23 '13 at 17:55
  • Dead link. Should post a proper answer to avoid this. – Rivera Jan 15 '19 at 14:36