I have UITableView
over the full screen. What I would like to know is to find the location where I clicked a cell.
What I want to do is to show the copy option when any cell is clicked.
For that I tried
- (void) touchesEnded:(NSSet *)touches
withEvent:(UIEvent *)event {
//some code
}
but this method is not getting called.
Any idea how can I find user touch over UITableView
if you just want to show Copy
option when any cell is clicked then you have to go for
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
method of tableView. there is no need to use Touch event
.
Using this method you can get the copy of selected cell using indexPath.
To get the position of selected cell you can use rectForRowAtIndexPath
method
CGRect rectInTableView = [tableView rectForRowAtIndexPath:indexPath];
CGRect rectInSuperview = [tableView convertRect:rectInTableView toView:[tableView superview]];