WebKit for SwiftUI: Observations

Is the new Observations API for WebPage not available in Beta 1 as demoed in the WWDC video? I get this error even though Observation is imported.

Answered by Frameworks Engineer in 843806022

Hi, thanks for trying out the new API! The Observations API from the Observable framework is not currently available in Beta 1.

Accepted Answer

Hi, thanks for trying out the new API! The Observations API from the Observable framework is not currently available in Beta 1.

Thank you for confirming. Am I correct in understanding this API is needed for the BackForwardList also? Or how is that used?

This is what I've done so far:

Button {
    page.load(page.backForwardList.backList.last!)
} label: {
     Image(systemName: "chevron.backward")
}
.disabled(page.backForwardList.backList.isEmpty)

The release notes for Xcode 26 Beta 3 says that Observations not being available is fixed but I still get the same compiler error.

WebKit for SwiftUI: Observations
 
 
Q