I am making an app with a variable amount of views all with a TapGestureRecognizer. When the view is pressed, i currently am doing this
func addView(headline: String) {
// ...
let theHeadline = headline
let tapRecognizer = UITapGestureRecognizer(target: self, action: Selector("handleTap:"))
// ....
}
but in my function "handleTap", i want to give it an additional parameter (rather than just the sender) like so
func handleTap(sender: UITapGestureRecognizer? = nil, headline: String) {
}
How do i send the specific headline (which is unique to every view) as an argument to the handleTap-function?