1.
NSUserDefaults* userDefaults = [NSUserDefaultsstandardUserDefaults];
if(![userDefaultsobjectForKey:@"miuuserfirst"]) {
UIImageView*tipsImageView = [[UIImageViewalloc]initWithFrame:CGRectMake(0, -64,kScreen_Width,kScreen_Height)];
tipsImageView.userInteractionEnabled=YES;
tipsImageView.tag=1;
UITapGestureRecognizer*tap = [[UITapGestureRecognizeralloc]initWithTarget:selfaction:@selector(changetipsImage:)];
[tipsImageViewaddGestureRecognizer:tap];
[tipsImageViewsetImage:[UIImageimageNamed:@"leadd3.jpg"]];
[self.viewaddSubview:tipsImageView];
self.tipsImageView= tipsImageView;
}
- (void)changetipsImage:(UITapGestureRecognizer*)tap
{
tap.view.tag++;
if(tap.view.tag>2) {
[self.tipsImageViewremoveFromSuperview];
self.tipsImageView=nil;
[[NSUserDefaultsstandardUserDefaults]setObject:@"icandoit"forKey:@"miuuserfirst"];
}else{
[self.tipsImageViewsetImage:[UIImageimageNamed:[NSStringstringWithFormat:@"leadd%ld.jpg",tap.view.tag]]];
NSLog(@"你调用了么");
}
}