下载地址:https://github.com/ninjinkun/NJKWebViewProgress
_progressProxy = [[NJKWebViewProgress alloc] init]; // instance variable
webView.delegate = _progressProxy;
_progressProxy.webViewProxyDelegate = self;
_progressProxy.progressDelegate = self;
-(void)webViewProgress:(NJKWebViewProgress *)webViewProgress updateProgress:(float)progress
{
[progressView setProgress:progress animated:NO];
}
progressProxy.progressBlock = ^(float progress) {
[progressView setProgress:progress animated:NO];
};
作者非常巧妙地通过计算需要加载的请求的个数,通过请求个数来现实加载进度,不得不佩服他的想法