Skip to content

Instantly share code, notes, and snippets.

@eladb
Last active August 29, 2015 13:56
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 eladb/f57eac0959a32075294b to your computer and use it in GitHub Desktop.
Save eladb/f57eac0959a32075294b to your computer and use it in GitHub Desktop.
@implementation MyStartupViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// first, hop to splash
[self hopTo:@"splash" then:^{
// then, hop to the onboarding sequence (but only once)
[self conditionalHopToOnboarding:^{
// then, hop to the main app controller (and that's it)
[self hopTo:@"main" then:nil];
}];
}];
}
// a nice little scheme to implement conditional hops
- (void)conditionalHopToOnboarding:(void(^)(void))next
{
if (/* first_use? */) {
[self hopTo:@"onboarding" then:next];
}
else {
next();
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment