Lesson 8

Supporting Multiple Device Types

If you have been developing iOS applications for a few years, you will have noticed the steady increase in the number of iOS-enabled devices in the market today. In this lesson, you learn about some of the differences between the different iOS devices and how to support them from a single code base.

When it comes to supporting the different devices, broadly speaking there are two main device families, iPhones and iPads. The obvious difference is the screen size, but there are some more subtle differences. For example, iPads cannot make phone calls or send text messages.

You could create separate binaries of your application for the iPhone and iPad, although the commonly accepted method is to create a single binary that works on both device families. Such a binary is called a universal application.

To create a universal application project in Xcode, set the device type to be Universal in the project options dialog box (see Figure 8.1). Although you can use any Xcode template to create a universal application, this lesson is based on the Single View Application template.

Screenshot of Xcode Project Options Dialog Box with Universal checked in drop down menu beside the word Devices.

Figure 8.1

Device Differences

While there are two main iOS device families (iPhones and iPads), within each family there are several devices. This section introduces the differences between these devices.

Screen Size

By far, the most visible aspect of a device is ...

Get Swift iOS 24-Hour Trainer 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.