     }
 
     /**
-     Initalises UIWebview.
-
-     */
-    fileprivate func initaliseLegacyWebView() {
-
-        self.legacyWebView = UIWebView(frame: self.view.bounds)
-        self.legacyWebView?.delegate = self
-        self.view = self.legacyWebView
-
-    }
-
-    /**
      Called if the user taps the cancel button.
      */
     @objc func closeView() {

    override func viewDidLoad() {
        super.viewDidLoad()

        if #available(iOS 9.0, *) {
            // use WKWebView on iOS 9.0 and later
            self.initialiseWebView()
        } else {
            // use UIView
            self.initaliseLegacyWebView()
        }

        let cancelButton = UIBarButtonItem(title: "Cancel", style: UIBarButtonItemStyle.plain, target: self, action: #selector(HPPViewController.closeView))
        self.navigationItem.leftBarButtonItem = cancelButton

}

/// The Web View Controller which encapsulates the management of the webivew and the interaction with the HPP web page.
class HPPViewController: UIViewController, WKNavigationDelegate,  WKUIDelegate, WKScriptMessageHandler {

    @IBOutlet var containerView : UIView? = nil

    var webView: WKWebView?

    var delegate:HPPViewControllerDelegate?

