I've been using the next line in my constants to differentiate between devices and get back the number of the device. What's the appropriate way to identify iPhone 5 and still keep it in a one line format?
#define iPhoneType [[UIScreen mainScreen] scale]==2 || [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad ? @"4" : @"3"
Thanks
Edit: A lot of good answers but my goal is to keep it in a one line format for all devices.
Edit: Based on the comments, this question needs some clarification. Here are the requirements:
- A single-line macro that returns either
@"3"
,@"4"
, or@"5"
depending on the iOS device. - The 4" devices (currently iPhone 5 and 5th gen iPod touch) should return
@"5"
. - All iPads and all remaining retina iPhones and iPod touches should return
@"4"
. - All remaining non-retina iPhones and iPod touches should return
@"3"
.