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:
- Implement a
WKNavigationActionDelegate
withdecidePolicy
- Call
WKWebView.loadHTMLString("some-string", baseURL: nil)
- Upon loading the HTML content, read the value of
navigationAction.sourceFrame
within thedecidePolicy
method of theWKNavigationActionDelegate
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 tonavigationAction.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?