Text and Web Views in iOS Apps - dummies

By Neal Goldstein, Dave Wilson

Text and Web views provide a way to display formatted text in your iPhone or iPad application. The UITextView class supports the display and editing of multiple lines of text in a scrollable area. The UIWebView class provides a way to display HTML content.

These views can be used as the Main view, or as a subview of a another view. (You encounter UIWebView in the example RoadTrip app as Weather views.) UIWebView is also the primary way to include graphics and formatted text in Text Display views.


The views that display content — such as the Detail views shown in the figures — are Web views, for some very good, practical reasons:

  • Some views must be updated regularly. Web views, in that context, are the perfect solution; they make it easy to access data from a central repository on the Internet. (Client/server is alive and well!)

  • Web views can easily display formatted data that’s locally stored. Real-time access isn’t always necessary — sometimes it’s perfectly fine to store some data on the iPad or iPhone. Web views have no problem with locally stored data, which is very handy.

  • Web views can access websites! Don’t overlook the obvious: Web views open the door to websites, which means you have the whole Internet at your beck and call. If users want more detailed weather information, for example, they can get to the ten-day forecast by simply touching a link.