You can do something like this:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
//do your core data load here
if(your core data condition){
UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"someViewController"];
self.window.rootViewController = viewController;
} else {
UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"someOtherViewController"];
self.window.rootViewController = viewController;
}
[self.window makeKeyAndVisible];
// Override point for customization after application launch.
return YES;
}
Careful, instantiateViewControllerWithIdentifier
refers to the storyboard identifier not the class name.