Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to avoid swipe to delete calling setEditing at the UITableViewCell
    primarykey
    data
    text
    <p>I know, that when I implement <code>tableView:willBeginEditingRowAtIndexPath:</code>and <code>tableView:didEndEditingRowAtIndexPath:</code>, a swipe-to-delete does not call <code>setEditing:animated:</code> at my <code>UITableViewController</code> (being the delegate of the <code>UITableView</code>).</p> <p>I have a custom <code>UITableViewCell</code> implementation that does a little UI rearrangements when going to edit mode. I wanted to be smart and implemented these changes in <code>setEditing:animated:</code> at the table view cell implementation itself (which obviously makes sense).</p> <p>However, when swiping to delete, I still get a call to <code>setEditing:animated:</code> at my table view cell implementation. And I have no parameter that tells me that I am swiping. The call stack also shows none of my own methods that would give me a chance to do something. It shows that <code>setEditing:animated</code> is called at the <code>UITableView</code>. The only thing obviously is, that it is not called at the delegate (my controller in this case).</p> <p>Of course, I could set a flag at the cell in <code>tableView:willBeginEditingRowAtIndexPath:</code> that tells it that the next <code>setEditing</code> call will be for a swipe, but that does not sound like good style.</p> <p><strong>Edit</strong>: it doesn't even work, because it is not guaranteed that <code>tableView:didEndEditingRowAtIndexPath:</code> is called, so I cannot set the flag back.</p> <p>Any ideas how to solve this issue elegantly?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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