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

# validateAction(_:)

Allows validation of the find action before performing.

```
func validateAction(_ op: NSTextFinder.Action) -> Bool
```

## Parameters

`op`

The sender’s tag.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the operation is valid; otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Responders the `NSResponder` method  [`performTextFinderAction(_:)`](/documentation/AppKit/NSResponder/performTextFinderAction(_:)) should call this method.

This method should be called by an implementation of [`validateUserInterfaceItem(_:)`](/documentation/AppKit/NSUserInterfaceValidations/validateUserInterfaceItem(_:)) to properly validate items with an action of [`performTextFinderAction(_:)`](/documentation/AppKit/NSResponder/performTextFinderAction(_:)). The responder’s [`validateUserInterfaceItem(_:)`](/documentation/AppKit/NSUserInterfaceValidations/validateUserInterfaceItem(_:)) or <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/validateMenuItem:> implementation should pass the tag as the action for this method..

---

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)