I have an issue with WKWebview. The pages load without any problems, but whenever I tap on any button on website, slide photos or accept cookies policy I get the following error:
2019-10-14 11:27:02.933458+0200 AppTitle[2592:447958] [general] Connection to daemon was invalidated
Does anyone know what may be the issue or what am I missing? This error causes further problems inside the app. Here is my code:
import UIKit
import WebKit
import TinyConstraints
class DetailsVC: UIViewController, WKNavigationDelegate, WKUIDelegate {
let myUrl = URL(string: "https://google.pl/")
var webView: WKWebView = {
let webview = WKWebView()
return webview
}()
func addWebView() {
view.addSubview(webView)
webView.edgesToSuperview(insets: .top(40) + .right(0) + .left(0), usingSafeArea: true)
webView.navigationDelegate = self
webView.uiDelegate = self
webView.load(URLRequest(url: self.myUrl!))
}
override func viewDidLoad() {
super.viewDidLoad()
// Add webview
addWebView()
}
}