Is it possible to cache web pages with a UIWebView

2019-08-25 02:24发布

I have an app that contains a UIWebView. I would like the user to be able to view webpages they've previously navigated to when off line. How should I go about making this work?

Thanks!

2条回答
男人必须洒脱
2楼-- · 2019-08-25 02:43

This is a similar question, but the intent was slightly different.

This answer provides detail on loading and caching the text content of a page, but you will still need to grab the other resources of the page (images, etc.) and store them locally like Ben describes.

查看更多
Emotional °昔
3楼-- · 2019-08-25 03:02

You're going to have to download and cache all the content for each page manually, then recreate them as local pages. There's nothing like Mac OS's .webarchive format on iPhone to save web content.

查看更多
登录 后发表回答