4

My collection view controller is not responding when swiping on a cell(touch begin in a point on the cell). But it interacts when swipe began a point such as spaces between the cells.

It was previously scrolling vertically, not touch gestures(there was once but i deleted it and nothing really changed) and recognizers in collection view and cell. The interesting part is collection view's didSelectCellAtRow works perfectly fine when interact on cell but not responsive to scrolls.

You can only scroll when swiping from the spaces between the cells or any point in collection view that is not containing cell.

Any thoughts?

Can Poyrazoğlu
  • 29,145
  • 40
  • 152
  • 327
Ugur
  • 194
  • 14
  • can please explain little more so the i can understand wt exactly is not working for u how u want vertical or horizontal – Shanthanu Aug 02 '14 at 14:26
  • Your question is very light on detail, but if your cell has a gesture recognizer set (or handles the touches), then the collection view of course does not receive those touches. You'd need to forward them. – DarkDust Aug 02 '14 at 14:26
  • For more enlightenment (in way we can't provide here), see this year's [WWDC 2014](https://developer.apple.com/videos/wwdc/2014/) session _Advanced Scrollviews and Touch Handling Techniques_ (a collection view is also a scroll view and the touch handling is the same). – DarkDust Aug 02 '14 at 14:28

1 Answers1

4

Are you sure the touch-down event is passed to the table view (scroll view) correctly? Make sure the cells don't have a custom touch-down event (e.g. tap gesture recognizer, or touchesBegan method without calling the super inside) and also make sure the collection view delays content touches, it's a common mistake to uncheck it and forget it, and then try to understand why a view is not handling touches properly, but its children are.

Can Poyrazoğlu
  • 29,145
  • 40
  • 152
  • 327