func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
        if(isFirst){
            webView.stopLoading()
            
            let sb = UIStoryboard(name: "Main", bundle:nil)
            let vc = sb.instantiateViewController(withIdentifier: "webView") as! WebViewController
            vc.url = String(describing: webView.url!)
            self.present(vc, animated: true, completion: nil)
        }
    }

注意红色字体部分,后面的感叹号不写不会报错和警告,但是运行出现闪退(具体原因不明),加上感叹号正常运行

webView 注意不能使用全局定义的变量

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
猜你喜欢
  • 2022-12-23
  • 2021-05-25
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
相关资源
相似解决方案