Last Updated: September 09, 2019
·
826
· codegefluester

Check if the device your App is running on is an iPhone 5 or iPod Touch 5th Generation

Just add this to your prefix file to have it available across your project

#define IS_PHONEPOD5() ([UIScreen mainScreen].bounds.size.height == 568.0f && [UIScreen mainScreen].scale == 2.f && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

Sample usage

if(IS_PHONEPOD5()) {
   // .. do some iPhone 5 stuff here...
}