I am making an application with a variable number of views using TapGestureRecognizer. When a view is clicked, I'm doing it now
func addView(headline: String) { // ... let theHeadline = headline let tapRecognizer = UITapGestureRecognizer(target: self, action: Selector("handleTap:")) // .... }
but in my "handleTap" function, I want to give it an additional parameter (and not just the sender) so
func handleTap(sender: UITapGestureRecognizer? = nil, headline: String) { }
How to send a specific header (which is unique for each view) as an argument to the handleTap function?
swift selector uitapgesturerecognizer
soer9606
source share