Webkit example
Asked on 06/16/2025
1 search
The session "Meet WebKit for SwiftUI" at WWDC 2025 introduces a new SwiftUI API that makes it easier to integrate web content into your apps. This session covers various aspects of using WebKit with SwiftUI, such as loading and displaying web content, observing changes, and customizing interactions. For example, you can use the new WebView
API to display web content by simply providing a URL, and the Webpage
class to observe properties like the page's title, current URL, and more. Additionally, you can evaluate JavaScript directly to interact with the web content.
For a specific example, the session demonstrates how to toggle between two URLs using a button, and how to observe changes in web content properties to update the UI, such as setting the navigation bar title to the page's title. You can also load different types of data, like web archive data, and handle custom URL schemes to manage local web resources.
If you are interested in learning more about these features, you can check out the session Meet WebKit for SwiftUI (00:01:54) for loading and displaying web content, and Meet WebKit for SwiftUI (00:09:37) for communicating with the page.

Meet WebKit for SwiftUI
Discover how you can use WebKit to effortlessly integrate web content into your SwiftUI apps. Learn how to load and display web content, communicate with webpages, and more.

What’s new in Safari and WebKit
Learn how the latest web technologies in Safari and WebKit can help you create incredible experiences. We’ll highlight different CSS features and how they work, including scroll driven animation, cross document view transitions, and anchor positioning. We’ll also explore new media support across audio, video, images, and icons.

What’s new in SwiftUI
Learn what’s new in SwiftUI to build great apps for any Apple platform. We’ll explore how to give your app a brand new look and feel with Liquid Glass. Discover how to boost performance with framework enhancements and new instruments, and integrate advanced capabilities like web content and rich text editing. We’ll also show you how SwiftUI is expanding to more places, including laying out views in three dimensions.