I\'m new to gesture recognizers so maybe this question sounds silly: I\'m assigning tap gesture recognizers to a bunch of UIViews. In the method is it possible to find out w
in swift it quite simple
Write this code in ViewDidLoad() function
let tap = UITapGestureRecognizer(target: self, action: #selector(tapHandler(gesture:)))
tap.numberOfTapsRequired = 2
tapView.addGestureRecognizer(tap)
The Handler Part this could be in viewDidLoad or outside the viewDidLoad, batter is put in extension
@objc func tapHandler(gesture: UITapGestureRecognizer) {
currentGestureStates.text = "Double Tap"
}
here i'm just testing the code by printing the output if you want to make an action you can do whatever you want or more practise and read