Skip to content

Instantly share code, notes, and snippets.

@ronaldmannak
Created February 28, 2014 07:34
Show Gist options
  • Save ronaldmannak/9266851 to your computer and use it in GitHub Desktop.
Save ronaldmannak/9266851 to your computer and use it in GitHub Desktop.
// JLRoutes delay
// In this version, the viewcontroller appears instantaneously
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIStoryboard *rootStoryboard = [UIStoryboard storyboardWithName:@"MainFeed" bundle:nil];
UIViewController *rootvc = [rootStoryboard instantiateInitialViewController];
self.window.rootViewController = rootvc;
return YES
}
// In this version, the app displays a black screen for several seconds before
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[JLRoutes addRoute:@"/mainfeed/" handler:^BOOL(NSDictionary *parameters) {
UIStoryboard *rootStoryboard = [UIStoryboard storyboardWithName:@"MainFeed" bundle:nil];
UIViewController *rootvc = [rootStoryboard instantiateInitialViewController];
self.window.rootViewController = rootvc;
return YES;
}];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"appname://mainfeed"]];
return YES
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment