I have dynamically added image view inside a scroll view
for(NSDictionary *str in slideShowImages){
UIImageView *image = [[UIImageView alloc ] initWithFrame:CGRectMake(x, 0, 200, 150)];
NSString *ImageURL = [str objectForKey:@"imageLink"];
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:ImageURL]];
image.image = [UIImage imageWithData:imageData];
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected:) ];
singleTap.numberOfTapsRequired = 1;
image.userInteractionEnabled = YES;
[image addGestureRecognizer:singleTap];
[documentory addSubview:image];
x += image.frame.size.width+ 5;
}
documentory.contentSize = CGSizeMake(x, documentory.frame.size.height);
when image view touch it call this event
-(void)tapDetected:{
}
i want to move to another uiview controller when the imageview touch i use story board and since the imageview added dynamically i don't have idea how to do this can anyone help me
PS is there a way that i can use
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {....}
in here thank you