title: How to open local html file on Safari?
body: <p>I want to open a local html file on <code>Safari</code> integration on my <code>Swift 3</code> application.</p>
  
  <p>I know how to do this with an url. This is the code that I use to do that:</p>
  
  <pre><code>let encodedString = url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
  
  let svc = SFSafariViewController(url: NSURL(string: encodedString!) as! URL)
  self.present(svc, animated: true, completion: nil)
  </code></pre>
  
  <p>But I am not able to do the same with a local file. I have copied my html file on my project and I can see it on the directories tree but I am not able to make it to work. I have looked at <a href="https://stackoverflow.com/questions/26647447/load-local-html-into-uiwebview-using-swift">Load local html into UIWebView using swift</a> for reference.</p>
  
  <p>How can I load a local html file into Safari integration?</p>
  
  <p>Thanks in advance!</p>