Gestures are a big part of iOS applications. For example, when we pinch on a picture, it gets zoomed, or when we rotate our device, the orientation of the picture changes. Detecting gestures in your application is very easy with the built-in UIGestureRecognizer
classes.
There are a few subclasses of UIGestureRecognizer
, each designed to detect a specific type of gesture. You can handle the most commonly used gestures with the following subclasses:
UITapGestureRecognizer
: This class detects the tapping gesture made on the device screen by the user.UIPinchGestureRecognizer
: This class detects the pinching gesture made on screen by the user. This motion is usually used to zoom in or out of a view or to change the size of a visual component.UIPanGestureRecognizer
: This class detects the dragging or panning gesture that the user makes.UISwipeGestureRecognizer
: This class detects when the user makes a swiping gesture across the screen. Instances of this class...