title: Objective C - Swipe to delete row
body: <p>I'm new to objective-c and gotten some legacy code for adding new features. <strong>My app needs that rows from a table are deleted by swiping then out</strong>. The <strong>implementation already support the ordering of rows</strong>. </p>
  
  <p>I have already read previous questions <a href="https://stackoverflow.com/questions/3309484/uitableviewcell-show-delete-button-on-swipe">UITableViewCell, show delete button on swipe</a> and <a href="https://stackoverflow.com/questions/21980208/using-swipe-gesture-to-delete-row-on-tableview">using swipe gesture to delete row on tableview</a>. <strong>I don't want to show any button for deleting rows</strong>( nor the (-) (red left button) neither the DELETE button that is displayed on the right when clicking the (-) red left button ).</p>
  
  <p>I have already defined the following methods:</p>
  
  <pre><code>- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      NSLog(@"editingStyleForRowAtIndexPath");
      return UITableViewCellEditingStyleNone;
  }
  
  - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
  {
      NSLog(@"canEditRowAtIndexPath");
      return YES; // allow that row to swipe
  }
  
  - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
      NSLog(@"commitEditingStyle");
  }
  </code></pre>
  
  <p>The behavior is that <strong>with this "configuration" the delete left red button is  displayed</strong>. When it is <strong>clicked, it displays a DELETE button on the right of the row</strong>. <strong>Clicking on it run the <code>commitEditingStyle</code> delegate</strong>.</p>
  
  <p>Removing the <code>tableView:editingStyleForRowAtIndexPath</code> make disappear the left red button and swipe does not work. Nor I manage to get execution in the <code>commitEditingStyle</code> delegate.</p>
  
  <p>Any suggestion or ideas why the <code>commitEditingStyle</code> delegate is not invoked?</p>