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

import WebKit

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

    }
    
    deinit {
        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 == self.kEstimatedProgress {
            self.webViewNavigationDelegate?.webViewLoadingWithProgress(self, progress: self.estimatedProgress)
        }
    }
