Check the userInterfaceIdiom property of the device to get the information you need:
Thanks for the heads up on this.
- (BOOL)isDeviceiPad { BOOL iPadDevice = NO; // Is userInterfaceIdiom available? if ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]) { // Is device an iPad? if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) iPadDevice = YES; } return iPadDevice; }
#define UI_USER_INTERFACE_IDIOM() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] ? [[UIDevice currentDevice] userInterfaceIdiom] : UIUserInterfaceIdiomPhone)
0 Comments