Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Recipe 5-10 modifies Recipe 5-9’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 5-9’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 5-10 depends on a macro that is used throughout which determines whether the code is being run on an iPad- or iPhone-style device:
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
This macro returns YES when the device characteristics are iPad-like, rather than being iPhone-like (such as on the iPhone or iPod touch). First introduced in iOS 3.2, idioms allow you to perform runtime checks in your code to provide interface choices that match the deployed platform.