1

Hi I am using a table view which has bigger Row height and I need to use two buttons Edit and Delete while swiping a cell. I got those two buttons using the following code :-

  -(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewRowAction *button = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
                                    {
                                       // Logic
                                    }];
    button.backgroundColor = [UIColor redColor]; //arbitrary color
    UITableViewRowAction *button2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@" Edit " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
                                     {
                    // Logic
                                     }];
    button2.backgroundColor = [UIColor lightGrayColor];
    return @[button, button2];
}

These two buttons occurs in a two column and I need them in a single column by two rows. I've seen almost all the table cells has this structure (multiple columns). Please help me

1 Answers1

0

There is an open source project on GitHub called https://github.com/srikanth-vm/GSSwipeableCell which implements that functionality.

Julian J. Tejera
  • 1,015
  • 10
  • 17