Difficulty handling touch events with a UITableView
<p>I am implementing a Google+ type iPhone application. The UI consists of a number of screen-sized panels, and the user can move through these panels horizontally by swiping left or right. I am not using a <code>UIScrollView</code> for this, but am instead implementing it as a series of <code>UIView</code>s on top of a master <code>UIView</code> - I override the <code>touches...</code> events for the <code>UIView</code>s and pass them on to the master <code>UIView</code> to handle repositioning the panels.</p>

<p>My code works perfectly as long as each panel is just an empty <code>UIView</code> (or if it only contains controls that don't pick up touch events, like a <code>UILabel</code>). The problem I'm facing is when I try to put a <code>UITableView</code> on one of the panels. Because the <code>UITableView</code> picks up the touch events, this is interfering with my own code that uses the touch events to slide the panels horizontally.</p>

<p>I have tried two approaches, neither of which is working perfectly:</p>

<p><strong>First approach:</strong> I subclass <code>UITableView</code>, overriding the <code>touch...</code> events (<code>touchesBegan</code>, <code>touchesMoved</code>, and <code>touchesEnded</code>). In the overrides, I pass the events on to <code>self.nextResponder</code> and then to <code>super</code>. On my table, I also set <code>canCancelContentTouches = NO;</code>. This works somewhat - if I start swiping with a perfectly horizontal movement, the underlying panel containing the table view moves left and right. However, if I begin the process by swiping vertically, the table view begins scrolling up and down and no horizontal movement happens at all until I lift my finger. Also, if I begin swiping horizontally the left-right movement of the panel happens, but until I life my finger no vertical scrolling of the table view is possible (I'm trying to get a solution where vertical movement scrolls the table view and horizontal movement moves the underlying panel left-right). BTW, without the <code>canCancelContentTouches = NO;</code> call, the touch events stop coming altogether as soon as the table view is scrolled even a little bit. </p>

<p><strong>Second approach:</strong> I subclass a <code>UIView</code>, set it's background color to transparent, and then place it over top of the view containing the <code>UITableView</code>. In this overlay subclass, I override the touch events and 1) pass them on to the underlying <code>UITableView</code> and then 2) pass the touch events on to the underlying <code>UIView</code> that handles the left-right swiping. With the approach, the left-right panel movement works perfectly. With the table view, unfortunately, the passed-through touch events allow me to click the table view and change the selected row (so I know the events are at least partially going through), but I can't scroll the table view up or down.</p>

<p>Any suggestions for how to do this correctly are welcome.</p>
