<!--
{
  "documentType" : "article",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/webkit-for-swiftui",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "WebKit for SwiftUI"
}
-->

# WebKit for SwiftUI

Integrate web content into your SwiftUI apps with new standard views you connect to webpages.

## Overview

Present web content in your SwiftUI app with WebKit for SwiftUI. Use WebKit features to observe content and customize the web browsing and display experience.

Create a [`WebView`](/documentation/WebKit/WebView-swift.struct) with a <doc://com.apple.documentation/documentation/Foundation/URL> to display your web content. Apply view modifiers for various customizations, like displaying a find navigator, customizing scrolling behavior, configuring gesture behavior, and more.

Connect [`WebView`](/documentation/WebKit/WebView-swift.struct) to a [`WebPage`](/documentation/WebKit/WebPage) to interact with and react to changes in web content, such as observing navigation progress and calling JavaScript. You can use [`WebPage`](/documentation/WebKit/WebPage) by itself when you don’t need to display the content directly.

> Note: For more information about using WebKit in your app using SwiftUI, see [Meet WebKit for SwiftUI](https://developer.apple.com/videos/play/wwdc2025/231) from WWDC25.

## Topics

### Essentials

[Building a cross-platform web browser](/documentation/WebKit/building-a-cross-platform-web-browser)

Implement a browser on multiple platforms that loads content, manages navigation history, and saves favorite websites, using WebKit for SwiftUI.

[`WebView`](/documentation/WebKit/WebView-swift.struct)

A view that displays some web content.

[`WebPage`](/documentation/WebKit/WebPage)

An object that controls and manages the behavior of interactive web content.

### Managing navigation between webpages

[`WebPage.NavigationDeciding`](/documentation/WebKit/WebPage/NavigationDeciding)

Allows providing custom behavior to handle navigation changes and to coordinate these changes for the web page’s main page.

[`WebPage.NavigationAction`](/documentation/WebKit/WebPage/NavigationAction)

An object that contains information about an action that causes navigation to occur.

[`WebPage.NavigationResponse`](/documentation/WebKit/WebPage/NavigationResponse)

An object that contains the response to a navigation request, and which you use to make navigation-related policy decisions.

[`WebPage.NavigationPreferences`](/documentation/WebKit/WebPage/NavigationPreferences)

A type that specifies the behaviors to use when loading and rendering page content.

[`WebPage.FrameInfo`](/documentation/WebKit/WebPage/FrameInfo)

A type that contains information about a frame on a webpage.

[`WebPage.NavigationPreferences.ContentMode`](/documentation/WebKit/WebPage/NavigationPreferences/ContentMode)

Options to indicate how to render web view content.

[`WebPage.NavigationPreferences.UpgradeToHTTPSPolicy`](/documentation/WebKit/WebPage/NavigationPreferences/UpgradeToHTTPSPolicy)

Preference for loading a webpage with HTTPS, and how failures should be handled.

[`WebPage.NavigationPreferences.SecurityRestrictionMode`](/documentation/WebKit/WebPage/NavigationPreferences/SecurityRestrictionMode-swift.enum)

Security restriction modes for WebView content.

[`WebPage.FormInfo`](/documentation/WebKit/WebPage/FormInfo)

A type that contains information about a form submission from a webpage.

### Observing navigation between webpages

[`WebPage.BackForwardList`](/documentation/WebKit/WebPage/BackForwardList-swift.struct)

An observable representation of a webpage’s previously loaded resources.

[`WebPage.NavigationEvent`](/documentation/WebKit/WebPage/NavigationEvent)

A particular state that occurs during the progression of a navigation.

[`WebPage.BackForwardList.Item`](/documentation/WebKit/WebPage/BackForwardList-swift.struct/Item)

A representation of a resource that a webpage previously visited.

[`WebPage.BackForwardList.Item.ID`](/documentation/WebKit/WebPage/BackForwardList-swift.struct/Item/ID-swift.struct)

An opaque type representing the identifier for an item.

### Configuring a WebPage

[`WebPage.Configuration`](/documentation/WebKit/WebPage/Configuration)

A configuration type that specifies the preferences and behaviors of a webpage.

[`WebPage.DeviceSensorAuthorization`](/documentation/WebKit/WebPage/DeviceSensorAuthorization)

A type that describes the authorization permissions policy for the device’s sensors a web resource may access.

[`URLScheme`](/documentation/WebKit/URLScheme)

A type representing a valid URL scheme.

[`URLSchemeHandler`](/documentation/WebKit/URLSchemeHandler)

A protocol for loading resources with URL schemes that WebKit doesn’t handle.

[`URLSchemeTaskResult`](/documentation/WebKit/URLSchemeTaskResult)

A value used as part of a sequence of results from a [`URLSchemeHandler`](/documentation/WebKit/URLSchemeHandler), which can either be a `Data` or a `URLResponse`.

[`WebPage.Configuration.MediaPlaybackBehavior`](/documentation/WebKit/WebPage/Configuration/MediaPlaybackBehavior-swift.enum)

The behavior used when playing HTML video within a page.

[`WebPage.DeviceSensorAuthorization.Permission`](/documentation/WebKit/WebPage/DeviceSensorAuthorization/Permission)

The kind of sensor permission a web resource may request to access.

### Immersive environments

[`WebPage.ImmersiveEnvironment`](/documentation/WebKit/WebPage/ImmersiveEnvironment)

An object representing a website-provided immersive environment that is ready for presentation.

[`WebViewImmersiveEnvironmentView`](/documentation/WebKit/WebViewImmersiveEnvironmentView)

A SwiftUI view that renders a specific website-provided immersive environment.

[`allowsImmersiveEnvironments`](/documentation/WebKit/WebPage/Configuration/allowsImmersiveEnvironments)

Indicates whether website immersive environments are allowed.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)