<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebEditingDelegate/webView(_:doCommandBy:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WebEditingDelegate(im)webView:doCommandBySelector:"
  },
  "title" : "webView(_:doCommandBy:)"
}
-->

# webView(_:doCommandBy:)

Returns whether the receiver performs a command instead of the web view.

```
optional func webView(_ webView: WebView!, doCommandBy selector: Selector!) -> Bool
```

## Parameters

`webView`

The web view that the user is editing.

`selector`

The command to perform.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the receiver will perform `command`; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Implement this method if you want to perform `command` instead of letting the web view perform `command`.

---

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)