A discrete gesture recognizer that interprets panning gestures.
- iOS 3.2+
- Mac Catalyst 13.0+
- tvOS 9.0+
UIPan is a concrete subclass of
UIGesture. Clients of this class can, in their action methods, query the
UIPan object for the current translation of the gesture (
translation(in:)) and the velocity of the translation (
velocity(in:)). They can specify a view’s coordinate system to use for the translation and velocity values. Clients can also reset the translation to a desired value.
The user must press one or more fingers on a view while panning it. A panning gesture is continuous. It begins (
UIGesture) when the user moves the minimum number of fingers allowed (
minimum) enough distance for recognition as a pan. It changes (
UIGesture) when the user moves a finger while pressing with the minimum number of fingers. It ends (
UIGesture) when the user lifts all fingers.