0
votes

I working on a universal iOS app that gets news from an RSS feed. The body of the news feed is HTML so I display it in a UIWebView. I account for when a user clicks a link so they can navigate back and forth from the original news and the links they click within that news article.

On iPhone when a user backs out of the ViewController of the individual news article and selects a different news article the UIWebView created fresh and work perfectly. But on my iPad version the I us a UISplitViewController and as the user clicks different news articles on the left the right side updates, but the UIWebView isn't created fresh.

My problem is that the UIWebView retains the history of other links the user may have clicked on in different news article.

Below is a flow of what happens on the iPad version

-User clicks on first news article --User clicks link in this article. WebView goes to Link. --User clicks back. WebView goes to original contents of news article -User clicks on different news article. --User clicks on link in this article. WebView goes to Link. --User clicks back. WebView goes to link that was clicked in first news article --User then has to click back again to get to original contents of this news article

I would like to have the UIWebView start as a "clean slate" when a new news article is selected.

1

1 Answers

4
votes

You can simply create a new one in the worst case. You can listen to links pressed with the UIWebViewDelegate protocol and see links being pressed and then simply re-create the web view.