Contents

deleteRows(at:with:)

Deletes the rows that an array of index paths identifies, with an option to animate the deletion.

Declaration

func deleteRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation)

Parameters

  • indexPaths:

    An array of Nsindexpath objects identifying the rows to delete.

  • animation:

    A constant that indicates how the deletion is to be animated, for example, fade out or slide out from the bottom. See Rowanimation for descriptions of these constants.

Discussion

When this method is called in an animation block defined by the beginUpdates() and endUpdates() methods, UITableView defers any insertions of rows or sections until after it has handled the deletions of rows or sections. This order is followed regardless how the insertion and deletion method calls are ordered. This is unlike inserting or removing an item in a mutable array, in which the operation can affect the array index used for the successive insertion or removal operation. For more on this subject, see Batch Insertion, Deletion, and Reloading of Rows and Sections in Table View Programming Guide for iOS.

See Also

Related Documentation

Inserting, deleting, and moving rows and sections