<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionView/performBatchUpdates(_:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionView(im)performBatchUpdates:completion:"
  },
  "title" : "performBatchUpdates(_:completion:)"
}
-->

# performBatchUpdates(_:completion:)

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

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

## Parameters

`updates`

The block that performs the relevant insert, delete, reload, or move operations.

`completion`

A completion handler block to execute when all of the operations finish. This block takes a single Boolean parameter that contains the value <doc://com.apple.documentation/documentation/Swift/true> if all of the related animations completed successfully or <doc://com.apple.documentation/documentation/Swift/false> if they were interrupted. This parameter may be `nil`.

## Discussion

You can use this method in cases where you want to make multiple changes to the collection view in one single animated operation, as opposed to in several separate animations. You might use this method to insert, delete, reload, or move cells or use it to change the layout parameters associated with one or more cells. Use the block passed in the `updates` parameter to specify all of the operations you want to perform.

If the collection view’s layout isn’t up to date before you call this method, a reload may occur. To avoid problems, you should update your data model inside the `updates` block or ensure the layout is updated before you call [`performBatchUpdates(_:completion:)`](/documentation/UIKit/UICollectionView/performBatchUpdates(_:completion:)).

Deletes are processed before inserts in batch operations. This means the indexes for the deletions are processed relative to the indexes of the collection 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

[`-  deleteItemsAtIndexPaths:`](/documentation/UIKit/UICollectionView/deleteItems(at:))

Deletes the items at the specified index paths.

[`-  moveSection:toSection:`](/documentation/UIKit/UICollectionView/moveSection(_:toSection:))

Moves a section from one location to another in the collection view.

[`-  moveItemAtIndexPath:toIndexPath:`](/documentation/UIKit/UICollectionView/moveItem(at:to:))

Moves an item from one location to another in the collection view.

[`-  insertItemsAtIndexPaths:`](/documentation/UIKit/UICollectionView/insertItems(at:))

Inserts new items at the specified index paths.

[`-  insertSections:`](/documentation/UIKit/UICollectionView/insertSections(_:))

Inserts new sections at the specified indexes.

[`-  deleteSections:`](/documentation/UIKit/UICollectionView/deleteSections(_:))

Deletes the sections at the specified indexes.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)