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

# addItem(_:)

Associates the specified dynamic item with the gravity behavior.

## Declaration

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

## Parameters

- `item`: The dynamic item to add to the item array. If the specified item is already associated with the gravity behavior, this method does nothing.

## Discussion

Discussion Use this method to add new dynamic items to the gravity behavior after initialization. All the dynamic items added to a gravity behavior are subject to the same gravity vector. If the gravity behavior has an associated dynamic animator, this method notifies the dynamic animator of the presence of the new item so that it can initiate any needed animations.

## See Also

### Managing a gravity behavior’s items

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