Giter VIP home page Giter VIP logo

Comments (6)

andreamazz avatar andreamazz commented on June 1, 2024

Hey @s951736
it should work fine, but it's hard to tell without more details. On top of my mind I could suggesting impelmenting the gesture's delegate method:

func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) {
  return true
}

from bubbletransition.

s951736 avatar s951736 commented on June 1, 2024

Hello, I should provide more detail.
Now my project is pretty simple, there are only two VC in it, and first VC has a button which triggers the segue with bubble transition (just like the demo project). The second VC has an UITapGestureRecognizer that detect tap for the whole VC. I hope the second VC can start to detect user's tapping right after the button in first VC been pressed, even when the bubble animation is running. (Now the animation duration is set to 0.5 as default so in this period of time it can't receive user's tapping)

Sorry, I'm pretty new to coding, so I can't fully understand the method you provided above, I tried adding the code to second VC but it still not accept gesture while animating.

Any suggestion would be appreciated!

from bubbletransition.

andreamazz avatar andreamazz commented on June 1, 2024

In your second VC set the delegate of the gesture to self, something like this:

someGesture.delegate = self

then add protocol conformity to your controller and add the aforementioned method. I like to do so in a separate extension at the bottom of the file:

extension SecondViewController: UIGestureRecognizerDelegate {
  func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    return true
  }
}

Change SecondViewController with your controller's name

from bubbletransition.

s951736 avatar s951736 commented on June 1, 2024

Thanks for the reply.
I tried the code but it seems not working. The second VC conformed to UIGestureRecognizerDelegate itself, so I add the func to the VC directly without using the extension, here is the code:

//TapVC is the second VC

class TapVC: UIViewController, UIGestureRecognizerDelegate {
    override func viewDidLoad() {
        super.viewDidLoad()
        let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap(sender:)))
        tap.delegate = self 
        self.view.addGestureRecognizer(tap)
    }    
    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
        return true
    }
}

from bubbletransition.

andreamazz avatar andreamazz commented on June 1, 2024

Does the gesture work if you use a standard transition? Because I reckon this is not an issue with this lib.

from bubbletransition.

andreamazz avatar andreamazz commented on June 1, 2024

Closing this for inactivity, reopen if you have more info.

from bubbletransition.

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.