iOS侧拉删除功能以及自定义侧拉显示文字
2017-02-21 本文已影响0人
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];
}
}
}