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 with a 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 to a WebPage to interact with and react to changes in web content, such as observing navigation progress and calling JavaScript. You can use WebPage by itself when you don’t need to display the content directly.
Topics
Essentials
Managing navigation between webpages
WebPage.NavigationDecidingWebPage.NavigationActionWebPage.NavigationResponseWebPage.NavigationPreferencesWebPage.FrameInfoWebPage.NavigationPreferences.ContentModeWebPage.NavigationPreferences.UpgradeToHTTPSPolicyWebPage.NavigationPreferences.SecurityRestrictionModeWebPage.FormInfo
Observing navigation between webpages
WebPage.BackForwardListWebPage.NavigationEventWebPage.BackForwardList.ItemWebPage.BackForwardList.Item.ID
Configuring a WebPage
WebPage.ConfigurationWebPage.DeviceSensorAuthorizationURLSchemeURLSchemeHandlerURLSchemeTaskResultWebPage.Configuration.MediaPlaybackBehaviorWebPage.DeviceSensorAuthorization.Permission