I have boiled down my issue to a very simple scenario and it appears to be with iOS 9+ and UIWebView with a website that has lots of page loads (like you would get from navigating).
I followed this tutorial (http://conecode.com/news/2011/05/ios-tutorial-creating-a-web-view-uiwebview/) to build a simple iOS app with a UIWebView. I pointed the UIWebView at a static html that looks like what I have at the bottom.
I then refreshed the page with the button (or the script that does it automaticly) and eventually the app grows slower and slower (usually around 50-80 refreshes). I have the list in the page for demonstration because it allows you to scroll, which highlights the issue much sooner.
Any help or direction for me to look into resolving this issue?
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<FORM><INPUT id="demo" TYPE="button" onClick="history.go(0)" VALUE="refresh"></FORM>
<ul data-role="listview" >
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
<li>This is an Item</li>
</ul>
<script>
var elem = document.getElementById("demo");
elem.value = Date();
location.reload();
</script>
</body>
</html>
How do I clear cache in iOS WebView? Open Settings. Swipe down and tap Safari. Swipe down again and tap Clear History and Website Data, tap it once again to confirm.
What is UIWebView? UIWebView is a deprecated iOS user interface control in Apple's UIKit framework. It loads HTML files and web content into an app view, rendering them as they would appear in a browser window.
Maybe a memory issue.
Watch the Memory Report (enlarge with double click) in Xcode while running the project and reloading/navigating the UIWebView.
If it is growing, try to delete the UIWebViews cache
Clearing UIWebview cache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With