基本左滑(印象笔记迁移)

  • (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    //第二组可以左滑删除
    if (indexPath.section == 2) {
    return YES;
    }

    return NO;
    }

// 定义编辑样式

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

// 进入编辑模式,按下出现的编辑按钮后,进行删除操作

  • (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {

      if (indexPath.section == 2) {
          
    
          
      } 
    

    }
    }

// 修改编辑按钮文字

  • (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
    return @"删除";
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 一、简介 <<UITableView(或简单地说,表视图)的一个实例是用于显示和编辑分层列出的信息的一种手段 <<...
    无邪8阅读 13,664评论 3 3
  • 概述在iOS开发中UITableView可以说是使用最广泛的控件,我们平时使用的软件中到处都可以看到它的影子,类似...
    liudhkk阅读 12,955评论 3 38
  • 课程要点:plist文件的新建与读取给UITableView设置变化的值单元格的删除、插入及刷新 plist...
    shiwuoo阅读 7,497评论 0 6
  • 1、tableView 的编辑模式 进入编辑模式 代码体现 // 设置 editing 属性tableView?....
    早起的虫儿子被鸟吃阅读 11,275评论 0 4
  • 今天一早醒来,就看到锦明老师深夜发的指导短信,特别感动!我把所有杂事忙完,就来到反思角,看完老师的信息,也和老师留...
    桃儿妈妈阅读 1,430评论 0 4