我正在使用购物应用程序和应用程序启动,它显示注册视图,然后单击跳过按钮,它将导航到Home View。我想在应用程序的一生中显示一次注册视图。
在此处添加我用来在整个应用程序生命周期中仅显示一次演练屏幕的代码。这对您可能很有用。
// 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
}