---
title: "addItem(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollisionbehavior/additem(_:)"
---

# addItem(_:)

Adds a dynamic item to the collision behavior’s item array.

## Declaration

```swift
func addItem(_ item: any UIDynamicItem)
```

## Parameters

- `item`: The dynamic item to add to the item array.

## Discussion

Discussion You can add a dynamic item to one or more collision behaviors. For example, you can use two collision behaviors to specify that item A can collide with item B and that item C can collide with item D, but that items A and B ignore items C and D. There is no hard limit to the number of dynamic items you can add to a collision behavior. However, adding a large number of items might result in a performance impact. Be sure to test your behaviors on the device configurations you are targeting.

## See Also

### Initializing and managing a collision behavior

- [init(items:)](uikit/uicollisionbehavior/init(items:).md)
- [removeItem(_:)](uikit/uicollisionbehavior/removeitem(_:).md)
- [items](uikit/uicollisionbehavior/items.md)
