Instance Method

addItem(_:)

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

Declaration

func addItem(_ item: UIDynamicItem)

Parameters

item

The dynamic item to add to the item array.

Discussion

You can add a dynamic item to one or more dynamic item behaviors. For example, you could add a dynamic item to one dynamic item behavior to configure the item’s elasticity and to a second dynamic item behavior to configure its density. This is especially useful when you are defining custom, combined behaviors for your dynamic items.

See Also

Initializing and Managing a Dynamic Item Behavior

init(items: [UIDynamicItem])

Initializes a dynamic item behavior with an array of dynamic items.

func removeItem(UIDynamicItem)

Removes a specific dynamic item from the dynamic item behavior.

var items: [UIDynamicItem]

Returns the set of dynamic items you’ve added to the dynamic item behavior.