ArisRS
ArisRS

Reputation: 1394

select UITableView cell with uitableviewcellselectionstylenone

I set uitableviewcellselectionstylenone on cells when I created cell. On long press I need to select exact cell, is it posible to do?

Upvotes: 2

Views: 447

Answers (1)

Sergey Kalinichenko
Sergey Kalinichenko

Reputation: 726579

Add a UILongPressGestureRecognizer to the table. You can find out the cell on which the user long-pressed by calling indexPathForRowAtPoint.

CGPoint p = [gestureRecognizer locationInView:self.myTableView];
NSIndexPath *indexPath = [self.myTableView indexPathForRowAtPoint:p];

See the accepted answer to this question for a complete example.

Upvotes: 1

Related Questions