==> Using Some swipe Delete And Insert Item Using This UITableViewDelegate :-
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.row == 0)
{
return UITableViewCellEditingStyleInsert;
}
else if(indexPath.row == 1)
{
return UITableViewCellEditingStyleDelete;
}
return UITableViewCellEditingStyleNone;
}
==> Used Insert And Delete In UITableView :-
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if(editingStyle == UITableViewCellEditingStyleDelete)
{
NSLog(@"Delete action performed for row - %lu", indexPath.row);
}
else if(editingStyle == UITableViewCellEditingStyleInsert)
{
NSLog(@"Insert action performed for row - %lu", indexPath.row);
}
}