UIWebView differs from Wkwebview does not load progress property to determine whether the load is complete
It has a callback method.
-(void) Webviewdidfinishload: (uiwebview *) WebView;
This method of Apple official documentation on its description is also vague
|
-(void) Webviewdidfinishload: (uiwebview *) WebView |
|
Description |
Sent after a Web view finishes loading a frame. |
|
Parameters |
|
WebView |
The Web view has finished loading. |
|
|
Availability |
IOS (2.0 and later) |
|
Declared in |
UIWebView.h |
|
Reference |
Uiwebviewdelegate Protocol Reference |
Through the test, found that the Finishload method is gone, not loaded.
The combination of JS method may be more perfect, refer to the two articles
Http://www.w3school.com.cn/ajax/ajax_xmlhttprequest_onreadystatechange.asp
Http://www.java2s.com/Book/JavaScript/DOM/document_readyState.htm
NSString *readystate = [WebView stringbyevaluatingjavascriptfromstring:@ "Document.readystate"]; BOOL complete = [readyState isequaltostring:@ ' complete ']; if (complete) { [self completeprogress]; }
iOS determines how UIWebView loading is done