Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The super call does the sliding 'to editing' animation so if you insert something after it, it won't take part in it. What you want to do is insert the row before that call and remove the row after. You'll also need to keep track of the rows with a different boolean.</p> <pre><code>- (void)setEditing:(BOOL)editing animated:(BOOL)animated { _amEditing = editing; if (editing) { [_table insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:_channels.count inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; } [super setEditing:editing animated:animated]; // keep the table in the same editing mode [self.view setEditing:editing animated:animated]; if (!editing) { [_table deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:_channels.count inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; } } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return _amEditing ? _channels.count + 1 : _channels.count; } </code></pre> <p>UPDATE:</p> <p>The second to last row's icon still has a strange animation.. to work around this you can add a delay to the deletion..</p> <pre><code> if (!editing) { [self performSelector:@selector(deleteLastRow) withObject:nil afterDelay:0.25]; } -(void) deleteLastRow { [self.view deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:_objects.count inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload