Skip to content

Instantly share code, notes, and snippets.

@djibouti33
Created September 15, 2015 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djibouti33/975b5f82fcd5fe04acc1 to your computer and use it in GitHub Desktop.
Save djibouti33/975b5f82fcd5fe04acc1 to your computer and use it in GitHub Desktop.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIStoryboard *destinationChooser = [UIStoryboard storyboardWithName:@"DestinationChooser" bundle:nil];
self.window.rootViewController = [destinationChooser instantiateInitialViewController];
[self.window makeKeyAndVisible];
if (![[AfarCurrentUser sharedCurrentUser] isSignedIn]) {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Welcome" bundle:nil];
UINavigationController *nav = [storyboard instantiateInitialViewController];
WelcomeViewController *welcome = (WelcomeViewController *)nav.topViewController;
welcome.presentationContext = AuthenticationPresentationContextSplash;
// ******* a little hack to have this run with no delay on the next run loop.
// ******* prevents a warning about 'Unbalanced calls to begin/end appearance transitions for UINavigationController'
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[self.window.rootViewController presentViewController:nav animated:false completion:nil];
});
} else {
presentOtherScreenAfterWelcome();
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment