Single vs Double Tap

  1. 7 weeks ago

    ingurgite

    Jul 28 User since 2018

    Hi,

    I am trying to have two distinct actions: single tap and double tap (two quick taps). What happens though is that both actions get called. Is there a way around this?

    Thanks.

  2. marco

    Jul 28 Administrator User since 2016

    Drop 2 TapGestures and in the double ones set "Taps Required" to 2 in the Inspector.

  3. ingurgite

    Jul 28 User since 2018

    Hi @marco. I did this already but when I double tap (at least in the simulator), it also triggers the one tap Action event.

    Also, the one tap conflicts with swipe up for instance, as swiping requires tapping and swiping.

    Any solution?

  4. 6 weeks ago

    andrea

    Jul 31 Administrator User since 2016

    Hi @ingurgite
    we'll do our best to add a way to fire a gesture (in your case the single-tap) only when another gesture fails (in your case the double-tap) in the next release.

  5. 5 weeks ago

    andrea

    Aug 5 Administrator User since 2016
    Edited 5 weeks ago by andrea

    @ingurgite
    A new function for the gesture recognizer objects, named requireToFail(), will be available in the next release.
    You will be able to add the following code in the WillShow event of the container of the two tap gestures:
    TapGesture1.requireToFail(TapGesture2)
    (where TapGesture1 is the single-tap and TapGesture2 is the double-tap)

  6. ingurgite

    Aug 6 User since 2018

    Thanks a lot @andrea. Out of curiosity, when do you think the next release will be out?

    Best.

  7. andrea

    Aug 6 Administrator User since 2016

    @ingurgite, the new official release will be available in about two weeks.
    In the meantime, you could try the new beta release that includes this new method:
    Creo build18340

  8. ingurgite

    Aug 6 User since 2018

    Thanks Andrea. It works. It's great.

    However, this beta version crashes every time I stop the simulator :(

  9. andrea

    Aug 6 Administrator User since 2016

    thank you for your feedback, we'll check this issue

  10. 2 weeks ago

    ingurgite

    Aug 30 User since 2018

    Hi @andrea, I am coming back to you as it seems the requireToFail() functionality is not yet in the stable release. Can you confirm or did something change?

    Thanks.

  11. andrea

    Aug 30 Administrator User since 2016

    Hi @ingurgite , the `requireToFail()` method is included in the newly released version and it is documented in the superclass documentation: UIGestureRecognizer

  12. ingurgite

    Sep 1 User since 2018

    Thanks.

or Sign Up to reply!