---
title: WKWebViewConfiguration
framework: webkit
role: symbol
role_heading: Class
path: webkit/wkwebviewconfiguration
---

# WKWebViewConfiguration

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

## Declaration

```swift
@MainActor class WKWebViewConfiguration
```

## Overview

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

- [websiteDataStore](webkit/wkwebviewconfiguration/websitedatastore.md)
- [userContentController](webkit/wkwebviewconfiguration/usercontentcontroller.md)
- [processPool](webkit/wkwebviewconfiguration/processpool.md)
- [applicationNameForUserAgent](webkit/wkwebviewconfiguration/applicationnameforuseragent.md)
- [limitsNavigationsToAppBoundDomains](webkit/wkwebviewconfiguration/limitsnavigationstoappbounddomains.md)
- [upgradeKnownHostsToHTTPS](webkit/wkwebviewconfiguration/upgradeknownhoststohttps.md)

### Configuring the web view’s preferences

- [preferences](webkit/wkwebviewconfiguration/preferences.md)
- [defaultWebpagePreferences](webkit/wkwebviewconfiguration/defaultwebpagepreferences.md)

### Adding handlers for custom URL schemes

- [setURLSchemeHandler(_:forURLScheme:)](webkit/wkwebviewconfiguration/seturlschemehandler(_:forurlscheme:).md)
- [urlSchemeHandler(forURLScheme:)](webkit/wkwebviewconfiguration/urlschemehandler(forurlscheme:).md)

### Configuring the rendering behavior

- [ignoresViewportScaleLimits](webkit/wkwebviewconfiguration/ignoresviewportscalelimits.md)
- [suppressesIncrementalRendering](webkit/wkwebviewconfiguration/suppressesincrementalrendering.md)

### Setting media playback preferences

- [allowsInlineMediaPlayback](webkit/wkwebviewconfiguration/allowsinlinemediaplayback.md)
- [allowsAirPlayForMediaPlayback](webkit/wkwebviewconfiguration/allowsairplayformediaplayback.md)
- [allowsPictureInPictureMediaPlayback](webkit/wkwebviewconfiguration/allowspictureinpicturemediaplayback.md)
- [mediaTypesRequiringUserActionForPlayback](webkit/wkwebviewconfiguration/mediatypesrequiringuseractionforplayback.md)
- [WKAudiovisualMediaTypes](webkit/wkaudiovisualmediatypes.md)

### Identifying data types

- [dataDetectorTypes](webkit/wkwebviewconfiguration/datadetectortypes.md)
- [WKDataDetectorTypes](webkit/wkdatadetectortypes.md)

### Setting selection granularity

- [selectionGranularity](webkit/wkwebviewconfiguration/selectiongranularity.md)
- [WKSelectionGranularity](webkit/wkselectiongranularity.md)

### Selecting user interface directionality

- [userInterfaceDirectionPolicy](webkit/wkwebviewconfiguration/userinterfacedirectionpolicy.md)
- [WKUserInterfaceDirectionPolicy](webkit/wkuserinterfacedirectionpolicy.md)

### Deprecated

- [mediaPlaybackAllowsAirPlay](webkit/wkwebviewconfiguration/mediaplaybackallowsairplay.md)
- [requiresUserActionForMediaPlayback](webkit/wkwebviewconfiguration/requiresuseractionformediaplayback.md)
- [mediaPlaybackRequiresUserAction](webkit/wkwebviewconfiguration/mediaplaybackrequiresuseraction.md)

### Initializers

- [init(coder:)](webkit/wkwebviewconfiguration/init(coder:).md)

### Instance Properties

- [allowsImmersiveEnvironments](webkit/wkwebviewconfiguration/allowsimmersiveenvironments.md)
- [allowsInlinePredictions](webkit/wkwebviewconfiguration/allowsinlinepredictions.md)
- [showsSystemScreenTimeBlockingView](webkit/wkwebviewconfiguration/showssystemscreentimeblockingview.md)
- [supportsAdaptiveImageGlyph](webkit/wkwebviewconfiguration/supportsadaptiveimageglyph.md)
- [webExtensionController](webkit/wkwebviewconfiguration/webextensioncontroller.md)
- [writingToolsBehavior](webkit/wkwebviewconfiguration/writingtoolsbehavior.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)

## See Also

### Web view configuration

- [WKWindowFeatures](webkit/wkwindowfeatures.md)
- [WKProcessPool](webkit/wkprocesspool.md)
- [WKPreferences](webkit/wkpreferences.md)
- [WKWebpagePreferences](webkit/wkwebpagepreferences.md)
