I need to clean the content of UIWebView(in order to reuse it), but I have some authentication handling code in its delegate methods, so I do not want to load an empty page like about:blank to clean it, as it will trigger my authentication handling code. So is there a way for doing this? (also, by reusing it, I need to put a spinner on top of the web view, and when it loads another page, I don't want the user see the previous loaded page content, so that's why I need to clean it)
Thanks!
If your only problem is that the spinner disappears when you load a blank page, you can use this code in webViewDidFinishLoad:
...then the spinner will go on until your webview is actually done loading.
this did the trick for me:
Try this out. This worked for me
You can just use this line of code :
Here you will find whole demo