Reputation: 9234
I have a UITableView
, and I press the row, but do not release finger, so didSelectRowAtIndexPath
is not called yet, right?
rowIsPressed
? or onTableViewTouchDown
?Upvotes: 1
Views: 1030
Reputation: 9977
There are two options at least:
1) You can subclass UITableViewCell and than use the touchhandling you know from a default uiview. (Like touchesBegan:
etc.) / OR add a custom uiview as contentView of the tablecell.
2) Add a gesturerecognizer to each tablecell.
To find out in which row you are, you could give every row a tag (which than refers to the row) in cellForRow:atIndexPath:
Upvotes: 2
Reputation: 2417
There is no such method to detect the selected state before lifting the finger... I guess you should override the UITableView class and add a UIGestureRecognizer to it. And about your second question, I think you are talking about this table view delegate method:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
But there is also another method that will give you the current selected row. This is it (directly from the table view class):
- (NSIndexPath *)indexPathForSelectedRow
Hope to have helped!
Upvotes: 0
Reputation: 2827
try this
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
Upvotes: 0