WKWebKit javascript execution when not attached to a view hierarchy

前端 未结 2 1134
日久生厌
日久生厌 2020-12-08 04:27

I want to switch to WKWebView from UIWebView. In my code, the web view instance is created offscreen (without attaching to the view hierarchy) and

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 04:56

    Having run into the same problem, I never found any solution except to add the WKWebView to the view hierarchy and move it offscreen with AutoLayout. Fortunately, this workaround does work reliably.

提交回复
热议问题