<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKNavigationDelegate/webView(_:decidePolicyFor:decisionHandler:)-2ni62",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WKNavigationDelegate(im)webView:decidePolicyForNavigationAction:decisionHandler:"
  },
  "title" : "webView(_:decidePolicyFor:decisionHandler:)"
}
-->

# webView(_:decidePolicyFor:decisionHandler:)

Asks the delegate for permission to navigate to new content based on the specified action information.

```
optional func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping @MainActor @Sendable (WKNavigationActionPolicy) -> Void)
```

## Parameters

`webView`

The web view from which the navigation request began.

`navigationAction`

Details about the action that triggered the navigation request.

`decisionHandler`

A completion handler block to call with the results about whether to allow or cancel the navigation. This handler has no return value and takes the following parameter:

- policy: A constant that indicates whether to cancel or allow the navigation. For a list of possible values, see [`WKNavigationActionPolicy`](/documentation/WebKit/WKNavigationActionPolicy).

## Discussion

Use this method to allow or deny a navigation request that originated with the specified action. The web view calls this method after the interaction occurs but before it attempts to load any content. If you implement this method, always execute the `decisionHandler` block at some point. You may execute it synchronously from your delegate method’s implementation, or execute it asynchronously after your method returns.

If your delegate object implements the [`webView(_:decidePolicyFor:preferences:decisionHandler:)`](/documentation/WebKit/WKNavigationDelegate/webView(_:decidePolicyFor:preferences:decisionHandler:)) method, the web view doesn’t call 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)