Post

Replies

Boosts

Views

Activity

Reply to This method should not be called on the main thread as it may lead to UI unresponsiveness.
I've just tried the DispatchQueue.main.async "workaround" using the production release of Xcode 14.1, and the problem persists. Furthermore, if using a WKWebView in an app where multiple windows can be shown, (i.e. iPad or Mac), then closing a window holding the WKWebView will crash the app if that window has called load(URLRequest). My test harness is such a lightwight SwiftUI app, short of some magic .INFO setting that I'm missing, I can't see how my code is contributing to the fault. My (unfounded) suspicion is that some magic code deep within WKWebView is making an async call for something like the default WKNavigationDelegate and that gives rise to the issue: but I could never prove that.
Nov ’22