title: Javascript call to Swift from UIWebView
body: <p>I am trying to make a call from a javascript function in a UIWebView to Swift in iOS 10. I have setup a very basic project just to try and get this working, the code is below. </p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UIWebViewDelegate  {    
    @IBOutlet var webView: UIWebView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          let url = Bundle.main.url(forResource: "products", withExtension: "html")
          let request = NSURLRequest(url: url! as URL)
          webView.loadRequest(request as URLRequest)
      }
  
      @IBAction func closeDocumentViewer() {
          displayView.isHidden = true;
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
      }
  }
  </code></pre>
  
  <p>If I just one to receive a string from a javascript function what would I have to add to the above? </p>