views:

147

answers:

2

I'm trying to better understand how UITableView and UITableViewCell work, and one part of that is touch handling.

So when I touch a row on a table view, what exactly happens? My basic understanding is:

  1. UITableView is a UIScrollView, so first it checks if it's a touch or a scroll
  2. If it's not a scroll then the touch gets analyzed to see which row is under the touchpoint
  3. It gets the cell at this indexPath (how?) and tells it to setHighLighted, setSeletected

Is that it? Does anybody have a more thorough understanding of it than that?

A: 

Probably somethign along the lines you mentioned, you never know though until you see t he source, why do you want to know anyway? you making your own tableview?

Daniel
Sort of. But really I just want to better understand how it works, so when I write something similar (but not a table) I have a good example. And the more I understand tables, the easier they are to work with (and optimize).
jbrennan
A: 

One last step is that the touch gets passed to the cells content view. That way any subviews in the cell will receive touch events. I'm pretty sure this comes after your step 3 and actions from cell selection will be processed first.

Corey Floyd