API to determine whether running on iPhone or iPad [duplicate]

Checkout UI_USER_INTERFACE_IDIOM.

Returns the interface idiom supported by the current device.

Return Value
UIUserInterfaceIdiomPhone if the device is an iPhone or iPod touch or UIUserInterfaceIdiomPad if the device is an iPad.

UIUserInterfaceIdiom

The type of interface that should be used on the current device

typedef enum {
   UIUserInterfaceIdiomPhone,
   UIUserInterfaceIdiomPad,
} UIUserInterfaceIdiom;

Leave a Comment