I have several images loading in a scrollview.
I set up the C4ScrollView like this:
viewer = [C4ScrollView scrollView:CGRectMake(20, 30, 75, self.canvas.height - 50)];
viewer.contentSize = CGSizeMake(75, 1000);
[self.canvas addSubview:viewer];
and then I put the images in and add the tap gesture (in a for loop) like this:
C4Image* img = [C4Image imgWithUrl:imgUrl];
[viewer addImage:img];
img.userInteractionEnabled = YES;
[img addGesture:TAP name:@"tap" action:@"tapped"];
[viewer listenFor:@"tapped" fromObject:img andRunMethod:@"imgTap:"];
then I have a method called imgTap like this:
-(void)imgTap:(NSNotification *)notification {
C4Image *img = (C4Image *)notification.object;
C4Log(@"image tapped");
}
But imgTap: method never gets called... Am I doing something wrong? Or do I have to do something differently in order to get the C4Image to recognize the gesture?