Contents

init(item:snapTo:)

Initializes a snap behavior with a dynamic item and a snap point.

Declaration

init(item: any UIDynamicItem, snapTo point: CGPoint)

Parameters

  • item:

    The dynamic item that you want to apply a snap behavior to.

  • point:

    The point that you want the dynamic item to snap to. The coordinate system for the point parameter depends on how you initialize the dynamic animator you’re adding the snap behavior to, as described in the overview of Uidynamicanimator.

Return Value

The initialized snap behavior, or nil if there was a problem initializing the object.

Discussion

At the conclusion of a snap, the rotation value (as indicated by the transform property) for a dynamic item is 0.