4

Is it possible to load content to SFSafariViewController like it was in UIWebView with loadHTMLString: method? I tried to find anything about it, but it seems that SFSafariViewController can show only Internet data, is it true?

daleijn
  • 718
  • 13
  • 22

2 Answers2

2

You can only load url in SFSafariViewController. It's an in-app Safari.

Lumialxk
  • 6,239
  • 6
  • 24
  • 47
  • Can I create url to local resource and pass to it? – daleijn Jul 12 '16 at 12:32
  • @daleijn Someone said you can load PDF. http://stackoverflow.com/questions/36608389/is-it-possible-to-load-local-pdf-file-on-sfsafariviewcontroller – Lumialxk Jul 12 '16 at 12:36
1

PFA Screenshot of safariServices framework

enter image description here

SFSafariViewController only support URLS and that of type http:// and https://

SFSafariViewController not support URL that are created from bundle or Document Directory resouces as they are starts with private:// or File://

So What you can do is

  1. Create local server in iOS app,
  2. Host that file on local server,
  3. and pass that url to SFSafariViewController.
Nayantara Jeyaraj
  • 2,624
  • 7
  • 34
  • 63