---
title: "shouldRequireFailure(of:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsgesturerecognizer/shouldrequirefailure(of:)"
---

# shouldRequireFailure(of:)

Overridden to indicate that the specified gesture recognizer must fail before the current object begins recognizing its gesture.

## Declaration

```swift
func shouldRequireFailure(of otherGestureRecognizer: NSGestureRecognizer) -> Bool
```

## Parameters

- `otherGestureRecognizer`: The gesture recognizer that must fail before the current object is allowed to recognize its gesture.

## Return Value

Return Value true to cause the current object to wait to recognize its own gesture until the object in otherGestureRecognizer fails.

## Discussion

Discussion Using this method lets you define rules that apply to all instances of your custom gesture recognizer class.

## See Also

### Methods for Subclasses

- [reset()](appkit/nsgesturerecognizer/reset().md)
- [mouseDown(with:)](appkit/nsgesturerecognizer/mousedown(with:).md)
- [mouseDragged(with:)](appkit/nsgesturerecognizer/mousedragged(with:).md)
- [mouseUp(with:)](appkit/nsgesturerecognizer/mouseup(with:).md)
- [otherMouseDown(with:)](appkit/nsgesturerecognizer/othermousedown(with:).md)
- [otherMouseDragged(with:)](appkit/nsgesturerecognizer/othermousedragged(with:).md)
- [otherMouseUp(with:)](appkit/nsgesturerecognizer/othermouseup(with:).md)
- [rightMouseDown(with:)](appkit/nsgesturerecognizer/rightmousedown(with:).md)
- [rightMouseDragged(with:)](appkit/nsgesturerecognizer/rightmousedragged(with:).md)
- [rightMouseUp(with:)](appkit/nsgesturerecognizer/rightmouseup(with:).md)
- [magnify(with:)](appkit/nsgesturerecognizer/magnify(with:).md)
- [rotate(with:)](appkit/nsgesturerecognizer/rotate(with:).md)
- [canBePrevented(by:)](appkit/nsgesturerecognizer/canbeprevented(by:).md)
- [canPrevent(_:)](appkit/nsgesturerecognizer/canprevent(_:).md)
- [shouldBeRequiredToFail(by:)](appkit/nsgesturerecognizer/shouldberequiredtofail(by:).md)
