Swiping-to-Delete Table Rows
Swipe-to-delete is a signature iOS interaction. Notably available in Mailapp, deleting and editing data in UITableViews is a built-in API and an easy way to add some polish to your app.
To allow the user to delete table rows, you need to implement yet more dataSource methods.
-
tableView:editingStyleForRowAtIndexPath:, where we determine how each row can be edited. If a row can be edited, then the table view will change the UI accordingly. After the user has acted upon that UI, like tapping the Delete button, we call commitEditingStyle:forRowAtIndexPath:.
-
tableView:commitEditingStyle:forRowAtIndexPath:, which is called after the user has edited or deleted some table view element. At this point, we need to actually ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access