I am experiencing the same problem and I’m now even thinking about replacing SSE with web sockets. This is affecting our production applications.
Have you devised a workaround?
I’ve also logged an issue with Apple, but there’s been no follow up.
Post
Replies
Boosts
Views
Activity
My solution to this was to instantiate the underlying web view on instantiation of the struct - not as part of the makeUIView method, although it is still returned by that. I'm unsure how this may contravene any view lifecycle rules. Here's the code anyhow:
struct WebView: UIViewRepresentable {
let url: URL
let webView = WKWebView()
func makeUIView(context: Context) -> WKWebView {
let request = URLRequest(url: url)
webView.load(request)
return webView
}
func reload() {
webView.reload()
}
func updateUIView(_ webView: WKWebView, context: Context) {
}
}