我在滚动视图中动态添加了图像视图
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);
当图像视图触摸它时调用此事件
-(void)tapDetected:{
}
当imageview触摸我使用故事板时,我想移动到另一个uiview控制器,并且由于imageview是动态添加的,我不知道如何做到这一点任何人都可以帮助我
PS有没有办法我可以使用
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {....}
在这里谢谢