title: UITableViewCell custom edit view
body: <p>I am trying to replace the default editing mode behaviour of the cells. </p>
  
  <p>I dont want the red circle with line left accessory view to appear. </p>
  
  <p>Upon entering edit mode I need it to shift the content view left &amp; display my delete button.</p>
  
  <p><em>What I have so far (custom UITableViewCell) overrides:</em></p>
  
  <pre><code>-(void) setEditing:(BOOL)editing animated:(BOOL)animated
  {
      /* don't call super */
  //    [super setEditing:editing animated:animated];
      _isEditing = editing;
  
      CGFloat newContentViewX = 0.0f;
      UIColor *newDeleteButtonColor = [UIColor clearColor];
  
      if ( _isEditing )
      {
          newContentViewX = -40.0f;
          newDeleteButtonColor = [UIColor redColor];
      }
  
      if ( animated )
      {
          [UIView animateWithDuration:0.5f
                                delay:0.0f
                              options:UIViewAnimationOptionCurveEaseInOut
                           animations:^
           {
               self.contentView.x = newContentViewX; //change frame.origin.x
               _deleteButton.backgroundColor = newDeleteButtonColor;
           }
                           completion:nil];
      }
      else
      {
          self.contentView.x = newContentViewX; //change frame.origin.x
          _deleteButton.backgroundColor = newDeleteButtonColor;
      }
  }
  
  -(BOOL) editing
  {
      return _isEditing;
  }
  </code></pre>
  
  <p>&amp; this is the result:
  <img src="https://i.stack.imgur.com/Uddt8.png" alt="setEditing:NO">
  <img src="https://i.stack.imgur.com/wXpTb.png" alt="setEditing:YES"></p>
  
  <p>The above code works great! Until it starts scrolling &amp; the contentview gets reset. back to the first image. The editing flag is not persisting my contentview frame changes.</p>
  
  <p>I have added this line:</p>
  
  <pre><code>[cell setEditing:_tableView.isEditing animated:NO];
  </code></pre>
  
  <p>in cellForRowAtIndexPath &amp; although it is calling &amp; setting edit mode correctly my contentview is still in the original position &amp; not the updated</p>
  
  <p>Short youtube video explaining issue:
  <a href="http://www.youtube.com/watch?v=aE9d9SdbnLU" rel="noreferrer">Youtube link</a></p>
  
  <p>Anyone else had this problem?</p>