SUMMARY

In this chapter, you have seen how to port an existing iPhone application to support both the iPhone and the iPad. In general, the Universal application approach is the recommended one, as it enables you to maintain just one code base that can target multiple platforms.

EXERCISES

  1. What function enables you to determine the device platform on which your application is currently running?
  2. What are the different values available for the Targeted Device Family setting in your Xcode project?

    Answers to the exercises can be found in Appendix D.

image WHAT YOU LEARNED IN THIS CHAPTER

TOPIC KEY CONCEPTS
Supporting an application natively on the iPhone and iPad Change the Devices item in the Summary tab of your project to Universal. Alternatively, modify the Targeted Device Family Setting of the project in Xcode, setting it to iPhone/iPad.
Detecting the device programmatically Use the UI_USER_INTERFACE_IDIOM() function.
Creating a Universal application Choose the Universal option in the Targeted Device Family setting when creating your new Xcode project.

Get Beginning iOS 5 Application Development 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.