title: ios Get table view cell index when edit action is pressed
body: <p>I have a table view that has cells with edit actions. When the user swipes one of the cells to the left, you can see the edit action buttons.</p>
  
  <p><a href="https://i.stack.imgur.com/cuztD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cuztD.png" alt="enter image description here"></a></p>
  
  <p>When the user taps one of the buttons, I need to get the index path of the cell that the buttons were clicked from. How can I do that?</p>
  
  <p><strong>NOTE</strong>, the edit action buttons arn't UIButtons, they are made like this.</p>
  
  <pre><code>-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
       UITableViewRowAction *button = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Reply" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
                                      {
  
   nil;
  
                                      }];
  
      button.backgroundColor = [UIColor colorWithRed:0.1 green:0.4 blue:0.9 
  
      alpha:1.0]; //arbitrary color
      }
  </code></pre>