SwiftUI용 WebPage에서 didFinishNavigation을 감지하려면 어떻게 해야 해?
Asked on 2025-07-05
1 search
To detect when didFinishNavigation
occurs in a SwiftUI WebPage, you can use the new observable currentNavigationEvent
property on the WebPage. This property allows you to access the navigation state and respond to different navigation events, including when the navigation is complete.
Here's a brief overview of how you can achieve this:
- Access the Navigation State: Use the
currentNavigationEvent
property to observe navigation events. - Use Observations API: With Swift 6.2, you can create an async sequence from
currentNavigationEvent
and use a loop to observe changes. This allows you to handle events likedidFinishNavigation
.
For more detailed guidance, you can refer to the session Meet WebKit for SwiftUI (09:48) where these concepts are discussed.

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 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.

Platforms State of the Union
Discover the newest advancements on Apple platforms.