I am working on a shopping app and on app launch, it shows signup view and once skip button is clicked it navigates to home view. I want to show signup view just once in who
Adding here the code I used to show walkthrough screen only once in the entire application lifecycle. This can be useful to you.
// show walkthough for first time only (first time the app launches after download).
bool shownFlag = [[NSUserDefaults standardUserDefaults] boolForKey:@"walkthroughShownOnce"];
if(!shownFlag){
[[NSUserDefaults standardUserDefaults] setBool:TRUE forKey:@"walkthroughShownOnce"];
[[NSUserDefaults standardUserDefaults] synchronize];
WalkThroughViewController *vc=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"WalkThroughViewController"];
[self.window makeKeyAndVisible];
[self.window setRootViewController:vc];
}else{
//if not walkthough go and check other task
}