Instance Method


Adds a dynamic behavior to a dynamic animator.


func addBehavior(_ behavior: UIDynamicBehavior)



The dynamic behavior instance you are adding.

The dynamic animator ignores your use of this method if you:

  • Provide a nil value

  • Provide a behavior instance that you’ve already added to the animator at the same level in the behavior hierarchy

See Also

Initializing and Managing a Dynamic Animator

init(referenceView: UIView)

Initializes a dynamic animator with a specified view as its reference view.

init(collectionViewLayout: UICollectionViewLayout)

Initializes a dynamic animator with a specified collection view layout.

func items(in: CGRect) -> [UIDynamicItem]

Returns the dynamic items, from the animator’s behaviors, that intersect a specified rectangle.

func removeBehavior(UIDynamicBehavior)

Removes a specified dynamic behavior from a dynamic animator.

func removeAllBehaviors()

Removes all of the dynamic behaviors from a dynamic animator.