0

hi in my application i have to disable the longpress gesture allowableMovement property i dont have any idea how to disable this. if anyone know please let me know. thanks in advance.

Bryan
  • 11,398
  • 3
  • 53
  • 78
Naresh
  • 19
  • 2
  • Did you mean `allowableMovement`? What does "disable" mean - do you want to allow no movement? – Bryan Sep 08 '12 at 07:43
  • yes i don't want to allow to track finger movement after long press using the long press gesture. – Naresh Sep 10 '12 at 05:19
  • So the scenario is: user touches UI; user holds finger steady for a while; action is fired on target; at this point you want to stop the gesture recognizer tracking the finger? Why? What else are you expecting to happen now? – Bryan Sep 10 '12 at 09:37
  • yes ur correct. Actually my requirement is when ever the user perform long press on an imageview popover will launch at that point , here after that based on finger moment that popover also moving around the view. that i want to disable. so please let me know if you have any idea. – Naresh Sep 10 '12 at 10:57
  • I haven't looked too closely into this area. Can you set up another gesture recognizer for the popover that has requireGestureRecognizerToFail: set on this one? – Bryan Sep 10 '12 at 11:28
  • how can i use another gesture because i have to launch that popover after long press. so as per my knowledge long press gesture is only the gesture i can use here. if we can use any other gesture for this requirement pls let me know. – Naresh Sep 11 '12 at 04:37
  • Hang on. Is the problem actually that your action method on the long press recognizer gets fired over and over again? – Bryan Sep 11 '12 at 07:43

1 Answers1

0

I suspect the problem you are seeing may be that some gesture recognizers are designed to fire multiple times as long as the gesture they recognize is still true. So a long press is a long press at 1 second, still a long press at 2 seconds, etc.

You should check the state of the UILongPressGestureRecognizer in your action method, as described here:

UILongPressGestureRecognizer gets called twice when pressing down

Community
  • 1
  • 1
Bryan
  • 11,398
  • 3
  • 53
  • 78