Currently I'm defining my app's background image in XCode's Attribute Inspector under Image View.
I'd like to, however, use a different background when an iPhone 5 views the app -- this is for a gaming app so certain screens have tables that I want to make longer. I know this has been written about a lot and some if/then statements are required. My question is: If I've already defined the background image using the Attribute Inspector, is there code to overwrite that which I can add to my .h and .m files?
Here's what I'm thinking: This is the code I'd add to my AppDelegate file:
#define IS_WIDESCREEN (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)568) < DBL_EPSILON)
#define IS_IPHONE ([[[UIDevice currentDevice]model] isEqualToString:@"iPhone"])
#define IS_IPOD ([[[UIDevice currentDevice]model] isEqualToString:@"iPod touch"])
#define IS_IPHONE_5 (IS_IPHONE && IS_WIDESCREEN)
This is the code I'd use in my .m file:
if(IS_IPHONE_5) {
} else {
}
So here really is what I'm looking for:
- Where do I put this code -- do I have to define a new (void) statement?
- What code do I use between the { } to call that new image and tell it to display as the background?