Reputation: 12787
How can i add green + button before a row in group table see in image
Upvotes: 0
Views: 268
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
Reputation: 1557
You can refer to this sample code link http://developer.apple.com/library/ios/#samplecode/ListAdder/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010275
Upvotes: 1