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

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

作者: iOS乐乐 | 来源:发表于2017-02-21 15:41 被阅读0次
- (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];
        }
    }
    
    
    
}

相关文章

网友评论

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

      本文链接:https://www.haomeiwen.com/subject/dtjuwttx.html