博客
关于我
iOS开发:UITableView实现侧滑删除cell的功能
阅读量:139 次
发布时间:2019-02-27

本文共 1509 字,大约阅读时间需要 5 分钟。

UITableView ? iOS ??????????????????????????????????????????????? UITableView ???????????????

1. ???????

??????? UITableView ??????????

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

????????????????????

2. ??????

??????????????????????

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

???? UITableViewCellEditingStyleDelete ??????????

3. ????????

??????????????????????????

- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {    return @"????";}

??????????????????????

4. ????????

???????????????????????????

- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {    return NO;}

??????????????????

5. ??????

?????????????????????????????

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {    // ????????????    LiveCollectionModel *collectionModel = _dataArray[indexPath.row];    [_dataArray removeObject:collectionModel];    [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationTop];}

????

  • ????????????????? _dataArray ?????
  • UI ????? MBProgressHUD ??loading??????????
  • ?????????????????????????????
  • ????????????? UITableView ?????????????????????????????????????

    转载地址:http://lclf.baihongyu.com/

    你可能感兴趣的文章
    Objective-C实现memcpy函数功能(附完整源码)
    查看>>
    Objective-C实现memoization优化技术算法(附完整源码)
    查看>>
    Objective-C实现memset函数功能(附完整源码)
    查看>>
    Objective-C实现merge insertion sort合并插入排序算法(附完整源码)
    查看>>
    Objective-C实现merge sort归并排序算法(附完整源码)
    查看>>
    Objective-C实现mergesort归并排序算法(附完整源码)
    查看>>
    Objective-C实现MidpointIntegration中点积分算法 (附完整源码)
    查看>>
    Objective-C实现miller rabin米勒-拉宾素性检验算法(附完整源码)
    查看>>
    Objective-C实现Miller-Rabin素性测试程序(附完整源码)
    查看>>
    Objective-C实现Miller-Rabin素性测试程序(附完整源码)
    查看>>
    Objective-C实现min cost string conversion最低成本字符串转换算法(附完整源码)
    查看>>
    Objective-C实现MinhashLSH算法(附完整源码)
    查看>>
    Objective-C实现MinhashLSH算法(附完整源码)
    查看>>
    Objective-C实现MinHeap最小堆算法(附完整源码)
    查看>>
    Objective-C实现minimum coin change最小硬币找零算法(附完整源码)
    查看>>
    Objective-C实现minimum cut最小切割流算法(附完整源码)
    查看>>
    Objective-C实现minimum partition最小分区算法(附完整源码)
    查看>>
    Objective-C实现Minimum Priority Queu最小优先级队列算法(附完整源码)
    查看>>
    Objective-C实现Minimum Vertex Cover最小顶点覆盖算法(附完整源码)
    查看>>
    Objective-C实现MinimumCostPath最小成本路径算法(附完整源码)
    查看>>