You can choose which view controller to instantiate first and use a different storyboard method (instantiateViewControllerWithIdentifier
:) to fetch it...
CGSize iosDeviceScreenSize = [[UIScreen mainScreen] bounds].size;
NSString *storyboardName = (iosDeviceScreenSize.height == 480)? @"iPhone4:4S:3Gs" : @"Main";
UIStoryboard *storyboard = [UIStoryboard storyboardWithName: storyboardName bundle:nil];
BOOL isUserLoggedIn = [dico[@"u_id"] boolValue]; // note the modern syntax for dictionary
NSString *vcId = (isUserLoggedIn)? @"LoggedInVCId" : @"NotLoggedInVCId";
// here's the punch line...
UIViewController *initialViewController = [storyboard instantiateViewControllerWithIdentifier:vcId];
Also note, by using a string variable for storyboardName
and vcId
, compress the code and improve readability.