---
title: UITapGestureRecognizer
framework: uikit
role: symbol
role_heading: Class
path: uikit/uitapgesturerecognizer
---

# UITapGestureRecognizer

A discrete gesture recognizer that interprets single or multiple taps.

## Declaration

```swift
@MainActor class UITapGestureRecognizer
```

## Mentioned in

Handling tap gestures Preferring one gesture over another

## Overview

Overview UITapGestureRecognizer is a concrete subclass of UIGestureRecognizer. For gesture recognition, the specified number of fingers must tap the view a specified number of times. Although taps are discrete gestures, they’re discrete for each state of the gesture recognizer. The system sends the associated action message when the gesture begins and then again for each intermediate state until (and including) the ending state of the gesture. Code that handles tap gestures should test for the state of the gesture, for example: Action methods handling this gesture can get the location of the gesture as a whole by calling the UIGestureRecognizer method location(in:). If there are multiple taps, this location is the first tap. If there are multiple touches, this location is the centroid of all fingers tapping the view. Clients can get the location of particular touches in the tap by calling location(ofTouch:in:). If multiple taps are allowed, this location is the first tap.

## Topics

### Configuring the gesture

- [buttonMaskRequired](uikit/uitapgesturerecognizer/buttonmaskrequired.md)
- [numberOfTapsRequired](uikit/uitapgesturerecognizer/numberoftapsrequired.md)
- [numberOfTouchesRequired](uikit/uitapgesturerecognizer/numberoftouchesrequired.md)

## Relationships

### Inherits From

- [UIGestureRecognizer](uikit/uigesturerecognizer.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Standard gestures

- [Handling UIKit gestures](uikit/handling-uikit-gestures.md)
- [Coordinating multiple gesture recognizers](uikit/coordinating-multiple-gesture-recognizers.md)
- [Adopting hover support for Apple Pencil](uikit/adopting-hover-support-for-apple-pencil.md)
- [Supporting gesture interaction in your apps](uikit/supporting-gesture-interaction-in-your-apps.md)
- [UIHoverGestureRecognizer](uikit/uihovergesturerecognizer.md)
- [UILongPressGestureRecognizer](uikit/uilongpressgesturerecognizer.md)
- [UIPanGestureRecognizer](uikit/uipangesturerecognizer.md)
- [UIPinchGestureRecognizer](uikit/uipinchgesturerecognizer.md)
- [UIRotationGestureRecognizer](uikit/uirotationgesturerecognizer.md)
- [UIScreenEdgePanGestureRecognizer](uikit/uiscreenedgepangesturerecognizer.md)
- [UISwipeGestureRecognizer](uikit/uiswipegesturerecognizer.md)
