title: Swift WKWebView Loading local file not working on a device
body: <p>I am having some issues when trying to run my app on an iPad (or any device) it runs as expected on the emulator so it is weird that it doesn't work on a device. I was wondering if some one could point me in the correct direction. I spend many hours reading all the other posts on here about the same issues, however none of the suggested solutions worked. </p>
  
  <p>I have a WKWebView into which I am loading a local html file. On the emulator the file loads and everything works fine but on a device I am getting a message in the log:</p>
  
  <p>Could not create a sandbox extension for '/'</p>
  
  <p>Here is the code I have that loads the file into the </p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      var path = NSBundle.mainBundle().pathForResource("Login_UK",
          ofType: "html")
      var url = NSURL(fileURLWithPath: path!)
      var request = NSURLRequest(URL: url!)
  
      var theConfiguration = WKWebViewConfiguration()
      theConfiguration.userContentController.addScriptMessageHandler(self,
          name: "callbackHandler")
  
      webView = WKWebView(frame: self.view.frame,
          configuration: theConfiguration)
      webView!.loadRequest(request)
      self.view.addSubview(webView!)
  }
  </code></pre>
  
  <p>Any help will be greatly appreciated </p>
  
  <p>Kind Regards,
  Dimitar</p>