---
title: "pressesCancelled(_:with:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uigesturerecognizer/pressescancelled(_:with:)"
---

# pressesCancelled(_:with:)

Sent to the receiver when a system event (such as a low-memory warning) cancels a press event.

## Declaration

```swift
func pressesCancelled(_ presses: Set<UIPress>, with event: UIPressesEvent)
```

## Parameters

- `presses`: A set of doc://com.apple.uikit/documentation/UIKit/UIPress instances in the event represented by event that represent the touches in the doc://com.apple.uikit/documentation/UIKit/UIPress/Phase-swift.enum/cancelled phase.
- `event`: A doc://com.apple.uikit/documentation/UIKit/UIEvent object that includes a reference to press.

## Mentioned in

About the Gesture Recognizer State Machine

## Discussion

Discussion This method has the same signature as the corresponding one declared by UIResponder. With this method a gesture recognizer receives press objects (in their UIPress.Phase.cancelled phase) before the view attached to the gesture recognizer receives them. UIGestureRecognizer objects are not in the responder chain, yet they observe presses hit-tested to their view and their view’s subviews. If the gesture recognizer is interpreting a continuous gesture, it should set its state to UIGestureRecognizer.State.began upon receiving this message. If at any point in its handling of the press objects the gesture recognizer determines that the press event sequence is not its gesture, it should set its state to UIGestureRecognizer.State.cancelled.

## See Also

### Implementing subclasses

- [touchesBegan(_:with:)](uikit/uigesturerecognizer/touchesbegan(_:with:).md)
- [touchesMoved(_:with:)](uikit/uigesturerecognizer/touchesmoved(_:with:).md)
- [touchesEnded(_:with:)](uikit/uigesturerecognizer/touchesended(_:with:).md)
- [touchesCancelled(_:with:)](uikit/uigesturerecognizer/touchescancelled(_:with:).md)
- [touchesEstimatedPropertiesUpdated(_:)](uikit/uigesturerecognizer/touchesestimatedpropertiesupdated(_:).md)
- [reset()](uikit/uigesturerecognizer/reset().md)
- [ignore(_:for:)](uikit/uigesturerecognizer/ignore(_:for:)-5f685.md)
- [canBePrevented(by:)](uikit/uigesturerecognizer/canbeprevented(by:).md)
- [canPrevent(_:)](uikit/uigesturerecognizer/canprevent(_:).md)
- [shouldReceive(_:)](uikit/uigesturerecognizer/shouldreceive(_:).md)
- [shouldRequireFailure(of:)](uikit/uigesturerecognizer/shouldrequirefailure(of:).md)
- [shouldBeRequiredToFail(by:)](uikit/uigesturerecognizer/shouldberequiredtofail(by:).md)
- [ignore(_:for:)](uikit/uigesturerecognizer/ignore(_:for:)-8qqor.md)
- [pressesBegan(_:with:)](uikit/uigesturerecognizer/pressesbegan(_:with:).md)
- [pressesChanged(_:with:)](uikit/uigesturerecognizer/presseschanged(_:with:).md)
