Contents

collisionBehavior(_:beganContactFor:with:at:)

Called when a collision between two dynamic items has begun.

Declaration

optional func collisionBehavior(_ behavior: UICollisionBehavior, beganContactFor item1: any UIDynamicItem, with item2: any UIDynamicItem, at p: CGPoint)

Parameters

  • behavior:

    The collision behavior that owns the dynamic items that have started to contact each other.

  • item1:

    The first of the two dynamic items participating in the collision.

  • item2:

    The second of the two dynamic items participating in the collision.

  • p:

    The contact point for the collision. The coordinate system that pertains to a collision depends on how you initialized the associated animator. For details, read the Overview of Uidynamicanimator.

See Also

Responding to UIKit Dynamics collisions