         webView.allowsBackForwardNavigationGestures = true
         return webView
     }()
-    
+
     lazy private var backBarButtonItem: UIBarButtonItem = {
         let bundle = NSBundle(forClass: self.classForCoder)
         let image = UIImage(named: "SimpleWebViewController.bundle/back", inBundle: bundle, compatibleWithTraitCollection: nil)

            fixedSpace
        ]
        toolbarItems = items
       
        if let navigationController = navigationController {
            navigationController.toolbar.barStyle = navigationController.navigationBar.barStyle
            navigationController.toolbar.tintColor = navigationController.navigationBar.tintColor
        }
    }
    
    public override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
       
        navigationController?.setToolbarHidden(false, animated: animated)
    }
    
    public override func viewWillDisappear(animated: Bool) {
        super.viewWillDisappear(animated)
        
        navigationController?.setToolbarHidden(true, animated: animated)
    }
    
    public override func viewDidDisappear(animated: Bool) {
        super.viewDidDisappear(animated)
        
        UIApplication.sharedApplication().networkActivityIndicatorVisible = false
    }
    
    public override func viewDidLoad() {
        super.viewDidLoad()
       
        updateToolBarItems()
    }
}

// MARK: WKNavigationDelegate
extension SimpleWebViewController: WKNavigationDelegate {
    public func webView(webView: WKWebView, didCommitNavigation navigation: WKNavigation!) {
        UIApplication.sharedApplication().networkActivityIndicatorVisible = true
        updateToolBarItems()
    }
    
    public func webView(webView: WKWebView, didFinishNavigation navigation: WKNavigation!) {
        navigationItem.title = webView.title
        UIApplication.sharedApplication().networkActivityIndicatorVisible = false
        updateToolBarItems()
    }
    
    public func webView(webView: WKWebView, didFailNavigation navigation: WKNavigation!, withError error: NSError) {
        UIApplication.sharedApplication().networkActivityIndicatorVisible = false
        updateToolBarItems()

        barButtonItem.width = 18.0
        return barButtonItem
    }()

    lazy private var forwardBarButtonItem: UIBarButtonItem = {
        let bundle = NSBundle(forClass: self.classForCoder)
        let image = UIImage(named: "SimpleWebViewController.bundle/forward", inBundle: bundle, compatibleWithTraitCollection: nil)
