Class

UIPinchGestureRecognizer

A discrete gesture recognizer that interprets pinching gestures involving two touches.

Declaration

class UIPinchGestureRecognizer : UIGestureRecognizer

Overview

UIPinchGestureRecognizer is a concrete subclass of UIGestureRecognizer.

The user must press two fingers on a view while pinching it. When the user moves the two fingers toward each other, the conventional meaning is zoom out; when the user moves the two fingers away from each other, the conventional meaning is zoom in.

Pinching is a continuous gesture. The gesture begins (UIGestureRecognizer.State.began) when the user moves the two fingers enough to create a pinch gesture. The gesture changes (UIGestureRecognizer.State.changed) when a finger moves (while both fingers remain touching). The gesture ends (UIGestureRecognizer.State.ended) when the user lifts both fingers from the view.

Topics

Interpreting the Pinching Gesture

var scale: CGFloat

The scale factor relative to the points of the two touches in screen coordinates.

var velocity: CGFloat

The velocity of the pinch in scale factor per second.

Relationships

Inherits From

Conforms To

See Also

Standard Gestures

Handling UIKit Gestures

Use gesture recognizers to simplify touch handling and create a consistent user experience.

Coordinating Multiple Gesture Recognizers

Discover how to use multiple gesture recognizers on the same view.

class UIHoverGestureRecognizer

A discrete gesture recognizer that interprets pointer movement over a view.

class UILongPressGestureRecognizer

A discrete gesture recognizer that interprets long-press gestures.

class UIPanGestureRecognizer

A discrete gesture recognizer that interprets panning gestures.

class UIRotationGestureRecognizer

A discrete gesture recognizer that interprets rotation gestures involving two touches.

class UIScreenEdgePanGestureRecognizer

A discrete gesture recognizer that interprets panning gestures that start near an edge of the screen.

class UISwipeGestureRecognizer

A discrete gesture recognizer that interprets swiping gestures in one or more directions.

class UITapGestureRecognizer

A discrete gesture recognizer that interprets single or multiple taps.