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

# prepareForTransition(from:)

Prepares the layout object to be installed in the collection view.

```
func prepareForTransition(from oldLayout: NSCollectionViewLayout)
```

## Parameters

`oldLayout`

The layout object installed in the collection view at the beginning of the transition. You might use this object to retrieve the current layout attributes for items and views.

## Discussion

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

---

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)