Instance Method

endUpdates()

Concludes a series of method calls that insert, delete, select, or reload rows and sections of the table view.

Declaration

func endUpdates()

Discussion

Use the performBatchUpdates(_:completion:) method instead of this one whenever possible.

You call this method to bracket a series of method calls that begins with beginUpdates() and that consists of operations to insert, delete, select, and reload rows and sections of the table view. When you call endUpdates, UITableView animates the operations simultaneously. Invocations of beginUpdates() and endUpdates can be nested. If you do not make the insertion, deletion, and selection calls inside this block, table attributes such as row count can become invalid.

See Also

Inserting, Deleting, and Moving Rows and Sections

func insertRows(at: [IndexPath], with: UITableViewRowAnimation)

Inserts rows in the table view at the locations identified by an array of index paths, with an option to animate the insertion.

func deleteRows(at: [IndexPath], with: UITableViewRowAnimation)

Deletes the rows specified by an array of index paths, with an option to animate the deletion.

func moveRow(at: IndexPath, to: IndexPath)

Moves the row at a specified location to a destination location.

func insertSections(IndexSet, with: UITableViewRowAnimation)

Inserts one or more sections in the table view, with an option to animate the insertion.

func deleteSections(IndexSet, with: UITableViewRowAnimation)

Deletes one or more sections in the table view, with an option to animate the deletion.

func moveSection(Int, toSection: Int)

Moves a section to a new location in the table view.

func performBatchUpdates((() -> Void)?, completion: ((Bool) -> Void)? = nil)

Animates multiple insert, delete, reload, and move operations as a group.

func beginUpdates()

Begins a series of method calls that insert, delete, or select rows and sections of the table view.