I am trying to layout my xib so that layout fits in both iphone 5 (4 inches retina) and 3.5 devices.
Because I have to support IOS-5 I cannot use autolayout. I have
If you go with the solution of using 2 xib files; in your initWithNibName() method simply make a call to super with the different nib name.
I would test on the original 480 height dimension rather than on the 568 height so that the larger xib file is selected when Apple releases a larger screen. In the future, at least the larger xib won't be letter-boxed as much as the smaller one.
// From MainView.m
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
// iPhone Classic
self = [super initWithNibName:@"MainView" bundle:nibBundleOrNil];
}
else
{
// iPhone 5 or maybe a larger iPhone ??
self = [super initWithNibName:@"MainView5" bundle:nibBundleOrNil];
}
return self;
}