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

# shouldBeRequiredToFail(by:)

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

```
func shouldBeRequiredToFail(by otherGestureRecognizer: NSGestureRecognizer) -> Bool
```

## Parameters

`otherGestureRecognizer`

The gesture recognizer that is not allowed to recognize its gesture until the current object fails.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> to cause `otherGestureRecognizer` to wait until the current object fails before beginning its own gesture recognition.

## 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)