Class

WKWebViewConfiguration

A collection of properties used to initialize a web view.

Declaration

@interface WKWebViewConfiguration : NSObject

Overview

Using the WKWebViewConfiguration class, you can determine how soon a webpage is rendered, how media playback is handled, the granularity of items that the user can select, and many other options.

WKWebViewConfiguration is only used when a web view is first initialized. You cannot use this class to change the web view's configuration after it has been created.

Topics

Configuring the New Web View’s Properties

applicationNameForUserAgent

The name of the application as used in the user agent string.

preferences

The preference object to be used by the web view.

processPool

The process pool from which to obtain the view’s Web Content process.

userContentController

The user content controller to associate with the web view.

websiteDataStore

The website data store to be used by the web view.

Determining Webpage Scalability

ignoresViewportScaleLimits

A Boolean value that determines whether a WKWebView object should always allow scaling of the webpage.

Setting Rendering Preferences

suppressesIncrementalRendering

A Boolean value indicating whether the web view suppresses content rendering until it is fully loaded into memory.

Setting Media Playback Preferences

allowsInlineMediaPlayback

A Boolean value indicating whether HTML5 videos play inline or use the native full-screen controller.

allowsAirPlayForMediaPlayback

A Boolean value indicating whether AirPlay is allowed.

allowsPictureInPictureMediaPlayback

A Boolean value indicating whether HTML5 videos can play picture-in-picture.

mediaTypesRequiringUserActionForPlayback

Determines which media types require a user gesture to begin playing.

mediaPlaybackAllowsAirPlay

Deprecated property. Instead, use allowsAirPlayForMediaPlayback.

Deprecated
requiresUserActionForMediaPlayback

A Boolean value indicating whether HTML5 videos require the user to start playing them (YES) or whether the videos can be played automatically (NO).

Deprecated
WKAudiovisualMediaTypes

The media types that require a user gesture to begin playing

Setting Selection Granularity

selectionGranularity

The level of granularity with which the user can interactively select content in the web view.

WKSelectionGranularity

The granularity with which a selection can be created and modified interactively.

Selecting User Interface Directionality

userInterfaceDirectionPolicy

The directionality of user interface elements.

WKUserInterfaceDirectionPolicy

The policy used to determine the directionality of user interface elements in a web view.

Identifying Data Types

dataDetectorTypes

The type of data detection desired.

WKDataDetectorTypes

The type of data detected.

Adding Handlers for New URL Schemes

- setURLSchemeHandler:forURLScheme:

Adds a URL scheme handler object for a given URL scheme.

- urlSchemeHandlerForURLScheme:

Returns the currently registered scheme handler for the given URL scheme

Instance Properties

Relationships

Inherits From

See Also

Initialization

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.

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.

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.