---
title: "webView(_:decidePolicyFor:decisionHandler:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wknavigationdelegate/webview(_:decidepolicyfor:decisionhandler:)-19mn2"
---

# webView(_:decidePolicyFor:decisionHandler:)

Asks the delegate for permission to navigate to new content after the response to the navigation request is known.

## Declaration

```swift
optional func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping @MainActor @Sendable (WKNavigationResponsePolicy) -> Void)
```

```swift
optional func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse) async -> WKNavigationResponsePolicy
```

## Parameters

- `webView`: The web view from which the navigation request began.
- `navigationResponse`: Descriptive information about the navigation response.
- `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:

## Mentioned in

Replacing UIWebView in your app

## Discussion

Discussion Use this method to allow or deny a navigation request after the web view receives the response to its original URL request. The navigationResponse parameter contains the details of the response, including the type of data that the response contains. 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.

## See Also

### Allowing or denying navigation requests

- [webView(_:decidePolicyFor:preferences:decisionHandler:)](webkit/wknavigationdelegate/webview(_:decidepolicyfor:preferences:decisionhandler:).md)
- [webView(_:decidePolicyFor:decisionHandler:)](webkit/wknavigationdelegate/webview(_:decidepolicyfor:decisionhandler:)-2ni62.md)
- [WKNavigationActionPolicy](webkit/wknavigationactionpolicy.md)
- [WKNavigationResponsePolicy](webkit/wknavigationresponsepolicy.md)
