- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
//iOS 8 需要实现
}
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"删除" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
[self deleteCheckerHttpRequestWith:indexPath];
}];
deleteAction.backgroundColor = [UIColor redColor];
UITableViewRowAction *editorAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"编辑" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
}];
editorAction.backgroundColor = [UIColor blueColor];
NSArray *arr = @[deleteAction,editorAction];
return arr;
}
刷新列表
NSIndexSet * index = [NSIndexSet indexSetWithIndex:i];
[_tableView reloadSections:index withRowAnimation:UITableViewRowAnimationAutomatic];
[_tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
UITableView 相关