WebKit's `decidePolicy` breaking change in iOS 18.5 + Xcode 16.4

It seems that in iOS 18.5+ built with Xcode 16.4+, there has been a breaking change since 18.4 with 16.3 within WebKit and how the navigationAction.sourceFrame property is initialized when implementing the decidePolicy delegate method.

The flow goes:

  1. Implement a WKNavigationActionDelegate with decidePolicy
  2. Call WKWebView.loadHTMLString("some-string", baseURL: nil)
  3. Upon loading the HTML content, read the value of navigationAction.sourceFrame within the decidePolicy method of the WKNavigationActionDelegate

On iOS 18.4 (and below) with Xcode 16.3 (and below);

  • navigationAction.sourceFrame is <uninitialized>

On iOS 18.5+ with Xcode 16.4+:

  • navigationAction.sourceFrame is already initialized and is equal to navigationAction.targetFrame

It appears that this change was made between minor versions of Xcode and is unexpected behavior of a minor version. Not only was this not called out in the release notes for Xcode 16.4 and iOS 18.5, but it's technically also a breaking change to the WebKit API.

Can we get insight on why this change was made and what Apple's policy is on breaking changes between minor versions of Xcode/iOS?

WebKit's &#96;decidePolicy&#96; breaking change in iOS 18.5 &#43; Xcode 16.4
 
 
Q