Note that there are some explanatory texts on larger screens.

plurals
  1. PONested UITableViews: a way to scroll both the outer vertical UITableView and a child horizontal UITableView at the same time?
    text
    copied!<p>When you're working with an atypical nested UITableViews setup - where you have an outer vertical UITableView that hosts 90° rotated UITableViews (see: <a href="https://stackoverflow.com/questions/3179683/looking-for-a-ui-library-to-present-data-horizontaly-in-ios">Looking for a UI library to present Data horizontaly in iOS</a> ): is there a way to make iOS process vertical <em>and</em> horizontal touches <em>at the same time</em>?</p> <p>I found that iOS is very clever in processing touches: horizontal touches make the relevant horizontal UITableView scroll, while a vertical swipe makes the outer UITableView scroll. Perfect.</p> <p>Only, I'd love to be able to move my finger diagonally and see the outer UITableView <em>and</em> the inner UITableView scroll at the same time. </p> <p>I tried a few approaches (playing with canCancelContentTouches, delaysContentTouches, and touch messages) but I haven't found a way to make this happen.</p> <p>EDIT: Here's a XCode4 project that shows this behavior: <a href="http://marcanton.io/other/stackoverflow/nestedtableviews.zip" rel="nofollow noreferrer">http://marcanton.io/other/stackoverflow/nestedtableviews.zip</a></p> <p>EDIT: I submitted this issue to Apple Developer Technical Support, here's their reply:</p> <blockquote> <p>Thank you for writing to Apple Worldwide Developer Technical Support. I am responding to your inquiry concerning touch events in embedded UITableViews.</p> <p>Typically this is an approach that is not recommended. The issue is that UITableView inherits from UIScrollView and as stated in the documentation for UIScrollView:</p> <p>"Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled."</p> <p><a href="http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html%23//apple_ref/occ/cl/UIScrollView" rel="nofollow noreferrer">http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html%23//apple_ref/occ/cl/UIScrollView</a></p> <p>So that this time, there is not a workaround for getting both to scroll at the same time.</p> <p>I recommend that you file an enhancement request at <a href="http://developer.apple.com/bugreporter/" rel="nofollow noreferrer">http://developer.apple.com/bugreporter/</a> detailing what you would like to see us add in a future release.</p> </blockquote> <p>Still, I think that there has to be a way to enable this functionality, although I understand that this is not recommended. In fact, Apple does not even recommend hosting UITableViews inside another UITableView, but with the exception made above, it works quite beautifully. I'll keep this question updated with our collective findings.</p> <p>EDIT: There actually is a way, detailed here: <a href="http://marcanton.io/blog/nested-orthogonal-tableviews/" rel="nofollow noreferrer">http://marcanton.io/blog/nested-orthogonal-tableviews/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload