In my app, i need to run different functions on a Tap Gesture depending on how many times a user taps the image.
I have a Tap Gesture Recognizer that requires for 1 tap.
My second tap Gesture recognizer requires for 2 taps. However, if I tap it 2 times, both functions for each tap gesture are called.
Is there a way I can do this, so the two functions can be called separately and not interfere with each-other?
The problem: If i tap the image two times, it calls the goWatchVideo function and the onDoubleTap function all together. I want to avoid this.
// Gesture that requires 1 tap
let tapToWatch = UITapGestureRecognizer(target: self, action: #selector(goWatchVideo))
tapToWatch.numberOfTapsRequired = 1
// Gesture that requires 2 taps
let doubleLike = UITapGestureRecognizer(target: self, action:#selector(self.onDoubleTap))
doubleLike.numberOfTapsRequired = 2
// Tried to set them up for failures
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered