Instance Method

setTranslation(_:in:)

Sets the translation value in the coordinate system of the specified view.

Declaration

func setTranslation(_ translation: CGPoint, in view: UIView?)

Parameters

translation

A point that identifies the new translation value.

view

A view in whose coordinate system the translation is to occur.

Discussion

Changing the translation value resets the velocity of the pan.

See Also

Tracking the Location and Velocity of the Gesture

func translation(in: UIView?) -> CGPoint

The translation of the pan gesture in the coordinate system of the specified view.

func velocity(in: UIView?) -> CGPoint

The velocity of the pan gesture in the coordinate system of the specified view.