reordering control in UITableView

前端 未结 5 787
青春惊慌失措
青春惊慌失措 2020-12-29 05:20

I am developing a game in which I am using a UITableView which has custom cell (UItableViewCell subclass).

In editing mode:

5条回答
  •  时光取名叫无心
    2020-12-29 06:15

    I know this answer might be late, but I'm putting it just for people who still need it. Just implement the following 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{
    
    }
    

提交回复
热议问题