Asks the data source to commit the insertion or deletion of a specified row in the receiver.
- iOS 2.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The table-view object requesting the insertion or deletion.
An index path locating the row in
When users tap the insertion (green plus) control or Delete button associated with a
UITable object in the table view, the table view sends this message to the data source, asking it to commit the change. (If the user taps the deletion (red minus) control, the table view then displays the Delete button to get confirmation.) The data source commits the insertion or deletion by invoking the
delete, as appropriate.
To enable the swipe-to-delete feature of table views (wherein a user swipes horizontally across a row to display a Delete button), you must implement this method.
You should not call
set within an implementation of this method. If for some reason you must, invoke it after a delay by using the