This is a Q&A post. To inform the many other users I saw who struggled with this issue as I browsed through StackOverflow’s database. None of these users ever got a solid answer (and most of them were posing the question years ago so I wasn’t going to bump the post).
The issue many struggled with is as follows:
When you try to load a page in a UIWebView and the page then loads another page maybe via an iFrame or it loads an advertisement through javascript you end up getting the page loading function called again and if you are using a UIActivityIndicator it will get called again as well and annoy your users.
The fix for this is to store the previous MainURL and to check the new MainURL that is trying to be loaded, if they match than ignore the load function. (Example code in my answer below)
**An example of a webpage that will call the webViewDidStartLoad method additional times after the web page has already really loaded would be: http://www.speakeasy.net/speedtest/
1 Answer