In this chapter, you learned how you can easily integrate the various built-in applications into your own iPhone applications. In particular, you saw how you can invoke the built-in SMS, Mail, Safari, and Phone simply by using a URL string. In addition, you learned how to send SMS and e-mail messages without leaving your application. You also learned about accessing the Photo Library applications using the classes provided by the iPhone SDK.
EXERCISES
Answers to the exercises can be found in Appendix D.
WHAT YOU LEARNED IN THIS CHAPTER
TOPIC | KEY CONCEPTS |
Sending e-mail from within your application |
NSString *emailString = @“mailto:[email protected]&subject=Subject&body=Body”; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:emailString]]; |
Invoking Safari |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @“http://www.apple.com”]]; |
Invoking the Phone |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @“tel:12345678*2” ]]; |
Invoking SMS |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @“sms:12345678*2” ]]; |
Accessing the Photo Library | Use the UIImagePickerController class and ensure that your View Controller conforms to the UINavigationControllerDelegate protocol. |
Invoking the Mail Composer UI | Use the MFMailComposeViewController class. |
Invoking the Message Composer UI | Use the MFMessageComposeViewController class. |
18.217.248.255