---
title: "didTransition(from:to:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscollectionviewelement/didtransition(from:to:)"
---

# didTransition(from:to:)

Tells the element that the layout object of the collection view changed.

## Declaration

```swift
@MainActor optional func didTransition(from oldLayout: NSCollectionViewLayout, to newLayout: NSCollectionViewLayout)
```

## Parameters

- `oldLayout`: The collection view’s previous layout object.
- `newLayout`: The current layout object associated with the collection view.

## Discussion

Discussion The default implementation of this method does nothing. Subclasses can override it and use it to finalize any behaviors associated with the change in layouts. Special Considerations In OS X 10.11, this method is never called.

## See Also

### Managing Layout Changes

- [preferredLayoutAttributesFitting(_:)](appkit/nscollectionviewelement/preferredlayoutattributesfitting(_:).md)
- [apply(_:)](appkit/nscollectionviewelement/apply(_:).md)
- [willTransition(from:to:)](appkit/nscollectionviewelement/willtransition(from:to:).md)
