<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewLayout/prepareForTransition(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionViewLayout(im)prepareForTransitionToLayout:"
  },
  "title" : "prepareForTransition(to:)"
}
-->

# prepareForTransition(to:)

Prepares the layout object to be uninstalled from the collection view.

```
func prepareForTransition(to newLayout: NSCollectionViewLayout)
```

## Parameters

`newLayout`

The layout object to install in the collection view at the end of the transition.

## Discussion

Prior to transitioning to a new layout object, the collection view calls this method on the old layout object to give it time to perform any cleanup operations.

---

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)