iOS侧拉删除功能以及自定义侧拉显示文字

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section==0)
    {
        return NO;
    }
    else
    {
        return YES;
    }
}

-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle ==UITableViewCellEditingStyleDelete)
    {
        [IanAlert confirmWithTitle:@"温馨提示" message:@"是否要删除该条信息" yes:@"确定" actionYes:^
         {
             NSLog(@"你点击了确定的按钮");
             
         } andno:@"取消" actionNo:^
         {
             
         }];
    }
   
}

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


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    if (indexPath.section==0)
    {
        if (indexPath.row==2)
        {
            MLLZhiDingAccountViewController*accountVC=[[MLLZhiDingAccountViewController alloc]init];
            [self.navigationController pushViewController:accountVC animated:YES];
        }
    }
    
    
    
}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容