Not only is the iPhone a great phone and great multimedia device, but it also has superb Internet capabilities. Among
Those capabilities are 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 causes 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 to your users.
Opening URLs using the iPhone
The first way to integrate Safari with your application is to allow users to open URLs within your application and then launch the iPhone Web browser externally with the URL loaded. The advantage of this technique from a user’s point of view is that the user can then stay in the browser; navigate the Web site, and so on. Essentially, you are handing off the user to your Web site. There are also several disadvantages with this technique. The first is that because it launches Safari, it exits your application. This means that any state that the user had going at the time that she launched the URL is probably going to be lost. Additionally, it can be quite a jarring experience for the user to be sent out of your application and over to Safari.
When considering whether to use this technique for displaying Web content, be sure to carefully weigh these advantages and disadvantages. A good example of this kind of interaction might be if you have a link inside your application that takes the user to more of your company’s products. In this case, the user is probably expecting to exit your application and go to your Web site. To utilize Safari in this way, you first need an NSURL containing the URL you want to access. You can create this using the NSURL initialize, init With String: or the factory method URL with String: Next, you use the Misapplication shared Application method to get the Misapplication singleton for your application. Finally, using the Misapplication singleton, you call the method open URL:, passing the URL that you created.
BIO:
Brents Lyons is an IT professional from Exam key. Are you really looking for this 350-018 exam assistance? Move ahead to take the benefit of lx0-102 and pass your exam easily .
Those capabilities are 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 causes 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 to your users.
Opening URLs using the iPhone
The first way to integrate Safari with your application is to allow users to open URLs within your application and then launch the iPhone Web browser externally with the URL loaded. The advantage of this technique from a user’s point of view is that the user can then stay in the browser; navigate the Web site, and so on. Essentially, you are handing off the user to your Web site. There are also several disadvantages with this technique. The first is that because it launches Safari, it exits your application. This means that any state that the user had going at the time that she launched the URL is probably going to be lost. Additionally, it can be quite a jarring experience for the user to be sent out of your application and over to Safari.
When considering whether to use this technique for displaying Web content, be sure to carefully weigh these advantages and disadvantages. A good example of this kind of interaction might be if you have a link inside your application that takes the user to more of your company’s products. In this case, the user is probably expecting to exit your application and go to your Web site. To utilize Safari in this way, you first need an NSURL containing the URL you want to access. You can create this using the NSURL initialize, init With String: or the factory method URL with String: Next, you use the Misapplication shared Application method to get the Misapplication singleton for your application. Finally, using the Misapplication singleton, you call the method open URL:, passing the URL that you created.
BIO:
Brents Lyons is an IT professional from Exam key. Are you really looking for this 350-018 exam assistance? Move ahead to take the benefit of lx0-102 and pass your exam easily .

No comments:
Post a Comment