Reputation: 6039
With my current table view controller, I'd like to implement a touch and hold feature very similar to how the click-wheel iPod's On-The-Go queueing feature used to work.
I've been reading a few posts and have seen suggestions for using UILongPressGestureRecognizer
. Whilst I could do that, it does bring up a couple more questions for me:
didSelectRowAtIndexPath
method from being called (Or do I
completely avoid using it and implement a Tap gesture recogniser in
my UITableViewCell subclass?)Would appreciate some guidance.
Upvotes: 0
Views: 540
Reputation: 7703
If you use the long press recognizer, and it fires, didSelectRowAtIndexPath will not fire.
You can detect the state of the gesture recognizer and animate your cell after the 'start' state is detected, and end the animation when the 'end' state is detected.
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) ... if (gestureRecognizer.state == UIGestureRecognizerStateEnded) ...
Upvotes: 1