I want to delete rows in a UITableView, I need to provide the delete button not by swipe but in a way similar to delete messages functionality in iPhones. In which on clicking edit a small red circle appears on the left in the cell which rotates when clicked and the delete button is shown. How to implement this?
Like in the image below:
See the Apple documentation here for details on how to achieve this. In particular:
When sent a
setEditing:animated
: message (with a first parameter ofYES
), the table view enters into editing mode where it shows the editing or reordering controls of each visible row, depending on theeditingStyle
of each associatedUITableViewCell
. Clicking on the insertion or deletion control causes the data source to receive atableView:commitEditingStyle:forRowAtIndexPath
: message. You commit a deletion or insertion by callingdeleteRowsAtIndexPaths:withRowAnimation
: orinsertRowsAtIndexPaths:withRowAnimation
:, as appropriate.