Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

322
Views
Caching websites for offline use with SFSafariViewController

I am using the following code to display a website in my app.

let webVC = SFSafariViewController(url: myUrl)
present(webVC, animated: true)

Now, I want to add offline reading. I know that iOS has a reading list, which apparently caches articles for offline use, but I could not find anything related in either the documentation for SFSafariViewController or elsewhere.

The only similar post I could find was this one (Swift iOS Cache WKWebView content for offline view) although it depends on WKWebView and writing a custom web archive exporter.

There must be a better way to achieve offline capabilities for SFSafariViewController, considering that it is newer and the recommended in-app method, and that Safari itself utilises an offline-mode for the iOS reading list. Any help?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It seems like you might be out of luck here. As suggested by this radar SFSafariViewController doen‘t even load data from the reading list.

That said, I don‘t think there is any possibility to achieve what you‘re trying to, other than, as in the link you have provided, writing a custom archive exporter and using WKWebView. As stated in it‘s documentation, SFSafariViewController only supports http or https url schemes, which makes this approach unsuitable for it.

If your application relies on this functionality, it shouldn’t be too hard to implement something like that, possibly using SwiftSoup or similar projects to extract and manipulate the links to reflect their on-disk path.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!