---
title: "canPerformAction(_:withSender:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/betextinput/canperformaction(_:withsender:)"
---

# canPerformAction(_:withSender:)

Indicates whether the text view can process a given action.

## Declaration

```swift
func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool
```

## Parameters

- `action`: A selector for the action.
- `sender`: The object that’s sending the message.

## Mentioned in

Integrating custom browser text views with UIKit Supporting extended text interactions

## Return Value

Return Value A Boolean value that indicates whether the text view can handle the action message.

## Discussion

Discussion This method is similar to responds(to:), except that even if your text view implements the action message, it can decline to handle it by returning false from this method.

## See Also

### Managing the edit menu

- [selectTextForEditMenuWithLocation(inView:completionHandler:)](browserenginekit/betextinput/selecttextforeditmenuwithlocation(inview:completionhandler:).md)
