Closed michiels closed 8 years ago
I'm experiencing this issue with my (UITabBar) app as well!
Without seeing a reproducible case, I can't say for sure what the issue is, but it sounds like the web view process is getting killed. This can happen since the web view runs in a different process from your app. There is a WKNavigationDelegate
method for this case - https://developer.apple.com/reference/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi. In Basecamp, we issue a reload whenever it happens:
func webViewWebContentProcessDidTerminate(webView: WKWebView) {
turbolinksSession.reload()
}
Try adding that and see if it helps.
@zachwaugh Many thanks. Let me try this out! It sounds plausible.
@michiels Did it work? Where can I place this code block within my own classes? I don't understand how I can override WKWebViewDelegate within my own classes without disturbing the Turbolinks library.
@michiels Did it work? Where can I place this code block within my own classes? I don't understand how I can override WKWebViewDelegate within my own classes without disturbing the Turbolinks library.
Same question ...
I am seeing behavior that Turbolinks webviews get cleared after backgrounding the app or not using it for a while. The navbar still shows, but the webview is just blank. Pull to refresh still works and after reloading via pull to refresh, the web content is visible again.
Is this some issue with memory management? Any way to prevent this or reload webviews after they are "cleared"?