<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewLayout/prepare(forCollectionViewUpdates:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionViewLayout(im)prepareForCollectionViewUpdates:"
  },
  "title" : "prepare(forCollectionViewUpdates:)"
}
-->

# prepare(forCollectionViewUpdates:)

Notifies the layout object that the contents of the collection view are about to change.

```
func prepare(forCollectionViewUpdates updateItems: [UICollectionViewUpdateItem])
```

## Parameters

`updateItems`

An array of [`UICollectionViewUpdateItem`](/documentation/UIKit/UICollectionViewUpdateItem) objects that identify the changes being made.

## Discussion

When items are inserted or deleted, the collection view notifies its layout object so that it can adjust the layout as needed. The first step in that process is to call this method to let the layout object know what changes to expect. After that, additional calls are made to gather layout information for inserted, deleted, and moved items that are going to be animated around the collection view.

---

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)