3
votes

I have a UIScrollView inside a UICollectionViewCell so I can zoom an image within that ScrollView. When I click the image I would like the CollectionViewCell to receive the event and pass it to the UICollectionView delegate.

I tried adding the following UIGestureRecognizerDelegate to the container of the UIScrollView:

-(BOOL)gestureRecognizer:ShouldReceiveTouch:

According to the answer I read the touch event should be passed on to the parent view - in this case the CollectionViewCell, but it isn't happening.

What should I do?

Edit Please note that I'm not trying to pinch zoom inside the cell but rather be able to receive the touch events of the cell.

1

1 Answers

2
votes

Thats a good question as I was having the same problem. The only way I could get the uicollectionviewcell to respond to touches (intercepted from the uiscrollview) was to set

userinteractionenabled = NO

on the scrollview.