<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISwipeGestureRecognizer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISwipeGestureRecognizer"
  },
  "title" : "UISwipeGestureRecognizer"
}
-->

# UISwipeGestureRecognizer

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

```
@MainActor class UISwipeGestureRecognizer
```

## Overview

[`UISwipeGestureRecognizer`](/documentation/UIKit/UISwipeGestureRecognizer) is a concrete subclass of [`UIGestureRecognizer`](/documentation/UIKit/UIGestureRecognizer).` `

[`UISwipeGestureRecognizer`](/documentation/UIKit/UISwipeGestureRecognizer) recognizes a swipe when the user moves the specified number of touches ([`numberOfTouchesRequired`](/documentation/UIKit/UISwipeGestureRecognizer/numberOfTouchesRequired)) in an allowable direction ([`direction`](/documentation/UIKit/UISwipeGestureRecognizer/direction-swift.property)) far enough to create a swipe. Swipes can be slow or fast. A slow swipe requires high directional precision but a small distance; a fast swipe requires low directional precision but a large distance. Because a swipe is a discrete gesture, the system sends the associated action message just once per gesture.

You can determine the location where a swipe begins by calling the [`UIGestureRecognizer`](/documentation/UIKit/UIGestureRecognizer) methods [`location(in:)`](/documentation/UIKit/UIGestureRecognizer/location(in:)) and [`location(ofTouch:in:)`](/documentation/UIKit/UIGestureRecognizer/location(ofTouch:in:)). The former method provides the centroid if the gesture contains more than one touch; the latter provides the location of a particular touch.

## Topics

### Configuring the gesture

[`direction`](/documentation/UIKit/UISwipeGestureRecognizer/direction-swift.property)

The permitted direction of the swipe for this gesture recognizer.

[`numberOfTouchesRequired`](/documentation/UIKit/UISwipeGestureRecognizer/numberOfTouchesRequired)

The number of touches necessary for swipe recognition.

[`UISwipeGestureRecognizer.Direction`](/documentation/UIKit/UISwipeGestureRecognizer/Direction-swift.struct)

The direction of the swipe.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)