Initializer

init(frame:configuration:)

Returns a web view initialized with a specified frame and configuration.

Declaration

init(frame: CGRect, configuration: WKWebViewConfiguration)

Parameters

frame

The frame for the new web view.

configuration

The configuration for the new web view.

Return Value

An initialized web view, or nil if the object could not be initialized.

Discussion

This is a designated initializer that accepts a custom WKWebViewConfiguration. The initializer copies the specified configuration. Changing the configuration object after initializing the web view has no effect on the web view. You can use the init(frame:) method to initialize an instance with the default configuration. See WKWebViewConfiguration for default values.

See Also

Initializing a Web View

var configuration: WKWebViewConfiguration

A copy of the configuration to initialize the web view with.