Protocol

WKNavigationDelegate

The methods of the WKNavigationDelegate protocol help you implement custom behaviors that are triggered during a web view's process of accepting, loading, and completing a navigation request.

Declaration

@protocol WKNavigationDelegate

Topics

Initiating the Navigation

- webView:didCommitNavigation:

Called when the web view begins to receive web content.

- webView:didStartProvisionalNavigation:

Called when web content begins to load in a web view.

Responding to Server Actions

- webView:didCommitNavigation:

Called when the web view begins to receive web content.

- webView:didReceiveServerRedirectForProvisionalNavigation:

Called when a web view receives a server redirect.

Authentication Challenges

- webView:didReceiveAuthenticationChallenge:completionHandler:

Called when the web view needs to respond to an authentication challenge.

Reacting to Errors

- webView:didFailNavigation:withError:

Called when an error occurs during navigation.

- webView:didFailProvisionalNavigation:withError:

Called when an error occurs while the web view is loading content.

Tracking Load Progress

- webView:didFinishNavigation:

Called when the navigation is complete.

- webViewWebContentProcessDidTerminate:

Called when the web view’s web content process is terminated.

Permitting Navigation

- webView:decidePolicyForNavigationAction:decisionHandler:

Decides whether to allow or cancel a navigation.

- webView:decidePolicyForNavigationResponse:decisionHandler:

Decides whether to allow or cancel a navigation after its response is known.

Navigation Policies

WKNavigationActionPolicy

The policy to pass back to the decision handler from the webView:decidePolicyForNavigationAction:decisionHandler: method.

WKNavigationResponsePolicy

The policy to pass back to the decision handler from the webView:decidePolicyForNavigationResponse:decisionHandler: method.

Relationships

Inherits From

See Also

Initialization

WKProcessPool

A WKProcessPool object represents a pool of Web Content processes.

WKWindowFeatures

A WKWindowFeatures object specifies optional attributes for the containing window when a new web view is requested.

WKWebView

An object that displays interactive web content, such as for an in-app browser.

WKWebViewConfiguration

A collection of properties used to initialize a web view.

WKPreferences

A WKPreferences object encapsulates the preference settings for a web view.

WKUIDelegate

The WKUIDelegate class provides methods for presenting native user interface elements on behalf of a webpage.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software