views:

95

answers:

2

My app loads webpages off the internet using a UIWebView. However I'd like to modify the experience so the user won't perceive it to be a webpage. What are some of the things I can do? and how to do it?

examples: - Show the page when everything is loaded? - Fade in effect?

Suggestions please.

A: 

I assume you are wanting to display the page as if it is a resource contained within your app (and not something streaming from a browser?)

In this case, download the webpage to a local file and display it only once fully downloaded.

I provide sample code in this answer that you can easilyy adapt for a html page (rather than a pdf document)

davbryn
If the content is static and local, you can always just turn it into an image and bypass rendering problems altogether.
Joost Schuur
A: 

It is possible to monitor the delegate callbacks from UIWebView to determine when the page has finished loading, and then perform whatever visual effect you want at that time. If the web view is most or all of your view controller, you could defer pushing your view controller until that time, or you could fade in the view as you mentioned.

However, even when reading HTML from the local disk, there is a noticeable lag. Waiting for remote content to load will have even more latency. You also must deal with the realities of an unreliable network: sometimes, your content will never arrive.

Once the first page is loaded and displayed, though, your options will be limited. If you try to make it appear that it is a fully native application, it's going to be hard to explain the latency or why it doesn't run when the network is unavailable (airplane mode, no cell or Wi-Fi).

Steve Madsen