WKWebView: Is it possible to preload multiple URLs?

前端 未结 4 639
梦谈多话
梦谈多话 2021-01-15 03:45

Just migrated an app over to WKWebView and was wondering if there is any possible way to \'preload\' multiple URLs, but only display one at a time?

I ha

4条回答
  •  广开言路
    2021-01-15 04:33

    A relatively straight-forward way to do this is to create five NSData objects (asynchronoulsly), each initialized using the known urls. When you need to display one of them, you can convert the NSData to a string, and then call WKWebView's loadHTMLString function to change the displayed page.

提交回复
热议问题