<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionReusableView/willTransition(from:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionReusableView(im)willTransitionFromLayout:toLayout:"
  },
  "title" : "willTransition(from:to:)"
}
-->

# willTransition(from:to:)

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

```
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

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

---

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)