Code Monkey home page Code Monkey logo

Comments (6)

jegnux avatar jegnux commented on August 12, 2024

@haitacnj You should set a delegate on each of your gesture recognizer:

superview.tapGesture(configuration: { $0.delegate = self }).when...
label.tapGesture(configuration: { $0.delegate = self }).when...

and implement the following method:

func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool

from rxgesture.

haitacnj avatar haitacnj commented on August 12, 2024

@jegnux thank you, but in "gestureRecognizer" method

true to allow both gesture​Recognizer and other​Gesture​Recognizer to recognize their gestures simultaneously. The default implementation returns false—no two gestures can be recognized simultaneously.

both subscribe call back not call if return false

from rxgesture.

jegnux avatar jegnux commented on August 12, 2024

@haitacnj can you give some code please?

from rxgesture.

haitacnj avatar haitacnj commented on August 12, 2024

popup_rxgesture

@jegnux this's my case
(1) is always called although i touch on UILabel 1.
If (4) return false , nothing happen, both (1) and (3) aren't called
I hope only (3) to be called when i touch on UILabel1

Release 0.2.1 works perfectly, no need to to anything :) i keep using it

Thank,

  • Note:
    Release 1.0.0 is great but sometimes it doesn't work properly ( sometime subscribe twice in my UITableViewCell )

from rxgesture.

jegnux avatar jegnux commented on August 12, 2024

@haitacnj Keep the delegate only for the first gesture recognizer, then try to implement the following delegate method:

func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    if gestureRecognizer.view == self.view {
         return true
    }
    return false
}

Also, don't forget to remove the implementation of

func gestureRecognizer(_:,shouldRecognizeSimultaneouslyWith:) -> Bool

from rxgesture.

haitacnj avatar haitacnj commented on August 12, 2024

@jegnux thank you 👍

from rxgesture.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.