Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

316
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda