---
title: "init(collectionViewLayout:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uidynamicanimator/init(collectionviewlayout:)"
---

# init(collectionViewLayout:)

Initializes a dynamic animator with a specified collection view layout.

## Declaration

```swift
convenience init(collectionViewLayout layout: UICollectionViewLayout)
```

## Parameters

- `layout`: The collection view layout for the dynamic animator, serving as the reference view for a dynamic animator in collection-view mode.

## Return Value

Return Value The initialized dynamic animator, or nil if there was a problem initializing the object.

## Discussion

Discussion When you initialize a dynamic animator with this method, the behaviors (and their dynamic items) that you add to the animator employ the collection view layout’s coordinate system.

## See Also

### Initializing and managing a dynamic animator

- [init(referenceView:)](uikit/uidynamicanimator/init(referenceview:).md)
- [items(in:)](uikit/uidynamicanimator/items(in:).md)
- [addBehavior(_:)](uikit/uidynamicanimator/addbehavior(_:).md)
- [removeBehavior(_:)](uikit/uidynamicanimator/removebehavior(_:).md)
- [removeAllBehaviors()](uikit/uidynamicanimator/removeallbehaviors().md)
