Recipe: Creating Universal Split View/Navigation Apps

Recipe 7-4 modifies Recipe 7-3’s split view controller to provide a functionally equivalent application that runs properly on both iPhone and iPad platforms. Accomplishing this takes several steps that add to Recipe 7-3’s code base. You do not have to remove functionality from the split view controller approach, but you must provide alternatives in several places.

Recipe 7-4 uses a macro to determine whether the code is being run on an iPad- or iPhone-style device. It leverages the UIKit user interface idiom as follows:

#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

This macro returns YES when the device characteristics are iPad-like rather ...

Get The Core iOS Developer’s Cookbook, Fifth Edition 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.