<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSGestureRecognizer/shouldRequireFailure(of:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSGestureRecognizer(im)shouldRequireFailureOfGestureRecognizer:"
  },
  "title" : "shouldRequireFailure(of:)"
}
-->

# shouldRequireFailure(of:)

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

```
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

<doc://com.apple.documentation/documentation/Swift/true> to cause the current object to wait to recognize its own gesture until the object in otherGestureRecognizer fails.

## Discussion

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

---

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)