addItem(_:)
Associates the specified dynamic item with the gravity behavior.
Declaration
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
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.