You can check for iPhone 4/iPhone 5 and instantiated a storyboard according to it
Following code even tells you iPhone or iPad.
Can save iPhone or iPad bool globally through-out the App.
Note: by default iphone4 storyboard will be instantiated.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
iPhone5 = NO;
iPad = NO;
// Override point for customization after application launch.
UIStoryboard *storyBoard;
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
if ([UIScreen mainScreen].scale == 2.0f)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
CGFloat scale = [UIScreen mainScreen].scale;
result = CGSizeMake(result.width * scale, result.height * scale);
if(result.height == 960)
{
iPhone5 = NO;
// NSLog(@"iPhone 4, 4s Retina Resolution");
}
if(result.height == 1136)
{
iPhone5 = YES;
// NSLog(@"iPhone 5 Resolution");
storyBoard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
UIViewController *tabBarController = [storyBoard instantiateInitialViewController];
self.window.rootViewController = tabBarController ;
}
}
else
{
// NSLog(@"iPhone Standard Resolution");
iPad = YES;
}
}
else
{
iPad = YES;
}
return YES;
}