Quoting this post:
#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
Then simply check with:
if( IS_IPHONE_5 )
{}
else
{}
Mind you, you don't have to define this as a macro if you don't want to. Simplified version:
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
if ([[UIScreen mainScreen] bounds].size.height == 568) {
//5
}else{
//not 5
}
}else{
//iPad
}
And yes this works in landscape. Even though the orientation of the device has changed, the devices height remains the same. Getting the height of UIScreen is different then for example getting the height of a view.