     }
     
     deinit {
-        self.removeObserver(self, forKeyPath: "estimatedProgress")
+        self.navigationDelegate = nil
+        self.removeObserver(self, forKeyPath: self.kEstimatedProgress, context: self.context)
     }
     
     public override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
-        if keyPath == "estimatedProgress" {
+        if keyPath == self.kEstimatedProgress {
             self.webViewNavigationDelegate?.webViewLoadingWithProgress(self, progress: self.estimatedProgress)
         }
     }

import WebKit

public class WKWebViewEx: WKWebView, WebViewProtocol, WKNavigationDelegate {
    
    //替代WKNavigationDelegate，用于获取页面加载的生命周期
    public weak var webViewNavigationDelegate: WebViewNavigationDelegate?

    public override init(frame: CGRect, configuration: WKWebViewConfiguration) {
        super.init(frame: frame, configuration: configuration)
        self.navigationDelegate = self
        self.addObserver(self, forKeyPath: self.kEstimatedProgress, options: .New, context: self.context)
    }
    
    required public init?(coder: NSCoder) {
