I just submitted my first app to the app store (yay it was just approved!). I now want to update it to work with (look nicer on) the larger iPhone 5 screen. I don\'t intend
Here is a simple, working code sample for your view controller that shows how to load myXib-5.xib
on the iPhone 5 and myXib.xib
on iPhones/iPods predating the iPhone 5:
- (void)loadView
{
if([[UIScreen mainScreen] bounds].size.height == 568)
{
// iPhone 5
self.view = [[NSBundle mainBundle] loadNibNamed:@"myXib-5" owner:self options:nil][0];
}
else
{
self.view = [[NSBundle mainBundle] loadNibNamed:@"myXib" owner:self options:nil][0];
}
}
It assumes that you are only targeting the iPhone and not the iPad, to keep it simple.
The XIB's file owner's class property should also be set to the view controller that contains loadView
.