-
-
Save eladb/f57eac0959a32075294b 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
@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