---
title: "init(currentLayout:nextLayout:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uicollectionviewtransitionlayout/init(currentlayout:nextlayout:)"
---

# init(currentLayout:nextLayout:)

Initializes and returns a transition layout object.

## Declaration

```swift
init(currentLayout: UICollectionViewLayout, nextLayout newLayout: UICollectionViewLayout)
```

## Parameters

- `currentLayout`: The layout object currently in use by the collection view.
- `newLayout`: The new layout object that is being installed into the collection view.

## Return Value

Return Value An initialized transition layout object or nil if the object could not be created.

## Discussion

Discussion This method initializes the transition layout object and saves references to the current and new layout objects so that you can access them later. If you subclass and implement your own initialization method, you must call this method to initialize the superclass.

## See Also

### Initializing the transition layout object

- [init(coder:)](uikit/uicollectionviewtransitionlayout/init(coder:).md)
