Contents

WKWebViewConfiguration

A collection of properties that you use to initialize a web view.

Declaration

@MainActor class WKWebViewConfiguration

Overview

A WKWebViewConfiguration object provides information about how to configure a WKWebView object. Use your configuration object to specify:

  • The initial cookies to make available to your web content

  • Handlers for any custom URL schemes your web content uses

  • Settings for how to handle media content

  • Information about how to manage selections within the web view

  • Custom scripts to inject into the webpage

  • Custom rules that determine how to render content

You create a WKWebViewConfiguration object in your code, configure its properties, and pass it to the initializer of your WKWebView object. The web view incorporates your configuration settings only at creation time; you cannot change those settings dynamically later.

Topics

Configuring the web view’s behavior

Configuring the web view’s preferences

Adding handlers for custom URL schemes

Configuring the rendering behavior

Setting media playback preferences

Identifying data types

Setting selection granularity

Selecting user interface directionality

Deprecated

Initializers

Instance Properties

See Also

Web view configuration