I have 5 animated images in the image view and you want to allow the user to click on them base by default identifier and click on another view. I tried adding in gestures, but the image does not detect.
Can anyone advise me?
EDIT: I ended up not using it; instead, I install UIButton.
Thank you:)
viewDidLoad
self.defaultID = [[NSMutableArray alloc] initWithObjects:@"7",@"9",@"11",@"27",@"6",nil]; self.defaultImageCaption = [[NSMutableArray alloc] initWithObjects:@"Ver",@"Green",@"Red",@"CF",@"Dwarf",nil]; //default image imageViewTop.alpha = 1.0; imageViewBottom.alpha = 0.0; imageViewBottom = [[UIImageView alloc] initWithFrame:CGRectMake(0,44,320,367)]; imageViewTop = [[UIImageView alloc] initWithFrame:CGRectMake(0,44,320,367)]; singleDefaultTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleDefaultTap:)]; singleDefaultTap.numberOfTouchesRequired = 1; imageViewTop.userInteractionEnabled = YES; [imageViewTop addGestureRecognizer:singleDefaultTap]; imageViewTop.tag = 2000; UIView *topView = [[UIView alloc] initWithFrame:CGRectMake(0,44,320,367)]; [topView addSubview:imageViewTop]; [self.view addSubview:imageViewTop]; [self.view addSubview:topView]; [self.view addSubview:imageViewBottom]; [self nextAnimation]
-(void)nextAnimation{
Act
// show your warning ...
NSLog(@"tapped"); flowerDetails = [[FlowerDetailViewController alloc] initWithNibName:@"FlowerDetailViewController" bundle:Nil] ; Fr *fr = nil;
// click on the detailed view of the flower
source share