Created
September 15, 2015 04:37
-
-
Save djibouti33/975b5f82fcd5fe04acc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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