---
title: "performBatchUpdates(_:completion:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableview/performbatchupdates(_:completion:)"
---

# performBatchUpdates(_:completion:)

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

## Declaration

```swift
func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil)
```

## Parameters

- `updates`: The block that performs the relevant insert, delete, reload, or move operations. In addition to modifying the table’s rows, update your table’s data source to reflect your changes. This block has no return value and takes no parameters.
- `completion`: A completion handler block to execute when all of the operations are finished. This block has no return value and takes the following parameter:

## Discussion

Discussion Use this method in cases where you want to make multiple changes to the table view in one single animated operation, as opposed to several separate animations. Use the block passed in the updates parameter to specify all of the operations you want to perform. Deletes are processed before inserts in batch operations. This means the indexes for the deletions are processed relative to the indexes of the table view’s state before the batch operation, and the indexes for the insertions are processed relative to the indexes of the state after all the deletions in the batch operation.

## See Also

### Performing batch updates to rows and sections

- [beginUpdates()](uikit/uitableview/beginupdates().md)
- [endUpdates()](uikit/uitableview/endupdates().md)
