ios - Hiding ViewControllers after first launch -
In my application, I have a view controller that loads as a welcome screen. When you tap on "go", the other view controller appears that opens the user account. When information is presented, their profile appears. (This is a fun testing app) I want to make it so much that when users use registers, then their use of the profile then leaves the app, they do not have to register again. So I need help locating the app for the first time to launch, then the wellcome evaluator and the registrator should go after launch first.
WelcomeViewController:
- (BOOL) Application: (UIApplication *) Application was given FinishLaunchingWithOptions: (NSDictionary *) Launch Options {if ([[NSUserDefaults Standard Standard Defaults] BoolForKey: @ "Alang once"]] {ProfileViewController * profileVC = [[ProfileView controller alloc] initWithNibName: zero bundle: zero]; [Self-present ViewController: animated profileVC: not complete: zero]; } And {{NSUserDefaults Standard User Defaults] SETBOOL: Yes for Y: @ "Alang once"]; [[NSUserDefaults Standard User Defaults] Synchronize]; }} Register Viewer:
- (BOOL) Application: (UIApplication *) Application did the FinishLaunchingWithOptions: (NSDictionary *) launchOptions {if ( [[NSUserDefaults StandardUserDefaults] BoolForKey: @ "hasLaunchedOnce"] {Profile ViewController * Profile VC = [[ProfileView Controller Alloc] initWithNibName: Zero Bundle: Zero]; [Self-present ViewController: animated profileVC: not complete: zero]; } And {{NSUserDefaults Standard User Defaults] SETBOOL: Yes for Y: @ "Alang once"]; [[NSUserDefaults Standard User Defaults] Synchronize]; }}
NSUserDefaults is what you are looking for ... in NSUserDefaults Check / load on logged in user and application / startup ...
Comments
Post a Comment