---
title: "prepareForTransition(to:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscollectionviewlayout/preparefortransition(to:)"
---

# prepareForTransition(to:)

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

## Declaration

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

## Parameters

- `newLayout`: The layout object to install in the collection view at the end of the transition.

## Discussion

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.

## See Also

### Transitioning Between Layouts

- [prepareForTransition(from:)](appkit/nscollectionviewlayout/preparefortransition(from:).md)
- [finalizeLayoutTransition()](appkit/nscollectionviewlayout/finalizelayouttransition().md)
