1
votes

So I have a UITableView nested inside a UITableViewCell, like:

  • UITableView baseTable

    • UITableViewCell baseTableCell0

      • UITableView subTableView
        • UITableViewCell subTableViewCell
      • UIView subView
    • UITableViewCell baseTableCell1

      • UICollectionView subCollectionView
        • UICollectionViewCell subCollectionViewCell

subView has a UITapGestureRecognizer connected, acts like a button subTableView and subCollectionView should receives touch events and perform didSelectRowAtIndexPath

On iOS 8 this works fine, but when i'm testing on ios 7 the cells in subTableView and subCollectionView does not receives touch event anymore, the touch event is sent to [baseTableView tableview... didSelectRowAtIndexPath]. However the UITapGestureRecognizer on subView can still receive touch event.

  • update: ios 6 has this problem as well, so it only works on ios 8 so far
2

2 Answers

1
votes

Use this code on tab gesture object

tap.cancelsTouchesInView = NO;  
0
votes

Try changing the background color of your UITableView, UITableViewCell and UIView, this way you can see if your child view is not exceeding your parent view, if it is the case your child view is not going to receive touch events. Then either adjust Parent to show child fully or adjust child to remain in the parent boundary.

Hope it helps!

EDIT:

May be passing touch events to subviews can help.