Chapter 16. Integrating Safari

In This Chapter

Opening URLs in Safari
Integrating a Web browser into your app with UIWebView
Displaying HTML files from your application bundle

Not only is the iPhone a great phone and great multimedia device, but it also has superb Internet capabilities. Among those capabilities is one of the best Web browsers available on any mobile platform. That Web browser is Safari. When developing Safari for the iPhone, Apple leveraged its previous technology from Safari on the desktop and developed a Web browser that not only renders pages excellently, but also provides a wonderful mobile user experience. It provides this experience by effectively utilizing the touch screen on the iPhone so that interactions with the Web browser are incredibly intuitive. An example is the Zoom feature, which uses a pinch gesture.

From a developer's point of view, Apple has also provided you with an excellent API for working with Safari. You can open URLs from within your application that cause Safari to load and display Web content. You can also embed a Safari browser right into your applications so that you can use it both to display Web content by downloading URLs and also to display local content, such as files included in your application bundles.

In this chapter, you're going to take a look at how to do both of these things. the code is very straightforward, and so there's not much to it. However, by leveraging what you learn in this chapter, you can provide a richer experience ...

Get Cocoa Touch™ for iPhone® OS 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.