---
title: "willTransition(from:to:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionreusableview/willtransition(from:to:)"
---

# willTransition(from:to:)

Tells your view that the layout object of the collection view is about to change.

## Declaration

```swift
func willTransition(from oldLayout: UICollectionViewLayout, to newLayout: UICollectionViewLayout)
```

## Parameters

- `oldLayout`: The current layout object associated with the collection view.
- `newLayout`: The new layout object that is about to be applied to the collection view.

## Discussion

Discussion The default implementation of this method does nothing. Subclasses can override this method and use it to prepare for the change in layouts.

## See Also

### Managing layout changes

- [preferredLayoutAttributesFitting(_:)](uikit/uicollectionreusableview/preferredlayoutattributesfitting(_:).md)
- [apply(_:)](uikit/uicollectionreusableview/apply(_:).md)
- [didTransition(from:to:)](uikit/uicollectionreusableview/didtransition(from:to:).md)
