I have implemented a custom editing accessory view as described in my answer to this question. For the most part it works very well, but I have noticed a small problem with it.
When I scroll or select another row in the table view, my custom editing accessory is not dismissed. With the standard editing accessory (the delete button), a touch anywhere else on the table is captured and used to remove the delete accessory view - you can see this yourself on the built in Notes application, for instance, or in any other place with a standard editing accessory view.
This must be because I am returning UITableViewEditingStyleNone
when I am in swipe-to-delete mode. However, if I return any other mode then my custom editing accessory is not displayed.
How can I get back the functionality of the standard editing style, where a touch anywhere on the table view dismisses the editing accessory?
The cell is not subclassed, but it is loaded from a nib file with a custom layout. The editing accessory view is part of the nib file and connected via the editingAccessoryView outlet.
I have managed to halfway achieve the effect I want by storing the index path of a swipe-to-edited row and setting that cell out of editing mode if another row is selected or scrolling begins on the table. However, I'd like to do it properly.