title: The WKWebView was invalidated" UserInfo={NSLocalizedDescription=The WKWebView was invalidated
body: <p>I am trying to retrieve html using webView. I don't want to write my webView code in the view file therefore trying to implement it in a different class. Below is my code.</p>
  
  <pre><code>class BlobHelper: NSObject,WKNavigationDelegate{
  
      let webView = WKWebView()
  
      func getLyrics(){
  
  
          let url = URL(string: "https://Blob")!
          let request = URLRequest(url: url)
           webView.load(request)
          webView.evaluateJavaScript("document.getElementsByTagName('html')[0].innerHTML;", completionHandler: {(value,error)in
              print(value)
              print(error)
          })
      }
      func webView(_ webView: WKWebView,didFinish navigation: WKNavigation!) { print("loaded") }
  </code></pre>
  
  <p>When I execute the code I get <code>Optional(Error Domain=WKErrorDomain Code=3 "The WKWebView was invalidated" UserInfo={NSLocalizedDescription=The WKWebView was invalidated})</code>. </p>
  
  <p>What I tried
  I was able to retrieve html using static but couldn't get the didFinish to call after loading.
  Any help is appreciated.</p>