             navigationController?.popViewControllerAnimated(true)
         }
     }
-    
+
     override func didReceiveMemoryWarning() {
         super.didReceiveMemoryWarning()
         // Dispose of any resources that can be recreated.
     }
-    
+
     deinit {
         webView.navigationDelegate = nil
         webView.removeObserver(self, forKeyPath: "estimatedProgress")
     }
-    
-    
+
+
     //KVO callback
     override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
         if keyPath == "estimatedProgress" {


    func webView(webView: WKWebView, decidePolicyForNavigationResponse navigationResponse: WKNavigationResponse, decisionHandler: (WKNavigationResponsePolicy) -> Void) {
        decisionHandler(.Allow)
        let endTime = NSDate()
        let requestStartTime = timeStampsRecord[(navigationResponse.response.URL?.absoluteString)!] as! NSDate
        let elapsedSeconds = endTime.timeIntervalSinceDate(requestStartTime)
        print((navigationResponse.response.URL?.absoluteString)! + " loaded in " + "\(elapsedSeconds)" + "\n")
        AppDelegate.showToastWithText((navigationResponse.response.URL?.absoluteString)! + " loaded in " + "\(elapsedSeconds)" + " secs")
    }
}
        view.addSubview(webView)
        webView.navigationDelegate = self;
        webView.addObserver(self, forKeyPath: "estimatedProgress", options: .New, context: nil)

        //Setting up the constraints
        let heightConstaint = NSLayoutConstraint.init(item: webView, attribute:.Height, relatedBy: .Equal, toItem: view, attribute: .Height, multiplier: 1.0, constant: 0.0)
        let widthConstaint = NSLayoutConstraint.init(item: webView, attribute:.Width, relatedBy: .Equal, toItem: view, attribute: .Width, multiplier: 1.0, constant: 0.0)
        view.addConstraints([heightConstaint,widthConstaint])
    }

    func setupNavigationBarButtons() {
        let backbutton = UIBarButtonItem.init(title: "Back", style: .Plain, target: self, action: #selector(WKWebViewRenderController.backButtonPressed));
        self.navigationItem.leftBarButtonItem = backbutton;
    }

    func backButtonPressed() {
        if webView.canGoBack {
            webView.goBack()
