Pass Parameter with UITapGestureRecognizer
问题 Is there any way i can pass parameters with UITapGestureRecognizer? I've seen this answered for objective-c but couldn't find an answer for swift test.userInteractionEnabled = true let tapRecognizer = UITapGestureRecognizer(target: self, action: Selector("imageTapped4:")) // Something like text.myParamater test.addGestureRecognizer(tapRecognizer) And then receive myParameter under func imageTapped4(){} 回答1: One approach would be to subclass UITapGestureRecognizer and then set a property, I've