- Check NSUserDefaults if the help view was displayed (and dismissed) before
- Create UIImageView and add it to your view
- Add UITapGestureRecognizer to the imageView
- in the action of the tap gesture remove the help view and save to NSUserDefaults that the view was dismissed.
.
- (void)viewDidLoad {
[super viewDidLoad];
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"didDisplayHelpScreen"]) {
UIWindow *window = [[[UIApplication sharedApplication] windows] lastObject];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:window.bounds];
imageView.image = [UIImage imageNamed:@"78-stopwatch"];
imageView.backgroundColor = [UIColor greenColor];
imageView.alpha = 0.5;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissHelpView:)];
[imageView addGestureRecognizer:tapGesture];
imageView.userInteractionEnabled = YES;
[window addSubview:imageView];
}
}
- (void)dismissHelpView:(UITapGestureRecognizer *)sender {
UIView *helpImageView = sender.view;
[helpImageView removeFromSuperview];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"didDisplayHelpScreen"];
}