what's the changes in Webkit that allow embedded web views within an app.

Asked on 06/25/2025

1 search

Apple introduced several changes to WebKit that enhance the ability to embed web views within an app, particularly with SwiftUI. Here are the key updates:

  1. New SwiftUI APIs: WebKit now includes a full set of SwiftUI APIs, including a new WebView component. This component is designed to make it easy to display web content within your app by simply providing a URL. The WebView is powered by WebKit, similar to Safari, and allows for customization and interaction with web pages.

  2. Declarative WebView Component: A new declarative webview component has been introduced, specifically designed for SwiftUI. This component allows for more powerful and flexible integration of web content into apps.

  3. Web Page API: This new API allows for programmatic control of web content. It enables rich interaction with web pages, such as navigating programmatically and accessing page properties.

  4. Modern Swift Technologies: The new APIs are built with modern Swift technologies like observation and strict concurrency, simplifying the integration of web content into apps.

  5. Customization and Interaction: The new WebKit APIs support customizing user agents, calling JavaScript, and handling custom URL schemes, providing developers with extensive control over how web content is displayed and interacted with in their apps.

For more detailed information, you can refer to the session Meet WebKit for SwiftUI (00:01:54), which covers how to load and display web content using these new APIs.