Ishu
Ishu

Reputation: 12787

add + button before a row

How can i add green + button before a row in group table see in image

alt text

Upvotes: 0

Views: 268

Answers (2)

iPhoneDv
iPhoneDv

Reputation: 1969

- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {

    if(indexPath.row == 1)//type your condition here

    {   
        return UITableViewCellEditingStyleDelete;
    }
    else{

        return UITableViewCellEditingStyleInsert;
    } 

}


-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {

    if (editingStyle == UITableViewCellEditingStyleDelete) {

        //type your code here
    }else if(editingStyle == UITableViewCellEditingStyleInsert){

           //type your code here
        }
}

Upvotes: 3

Related Questions