In my UITableViewCell
I have a button. And I want to add action to it by passing multiple parameters in cellForRowAtIndexPath
method.
If you need to pass string just use accessibilityHint of UIButton.
Tag can only store Int so if anyone wants to pass string data can use this. However, this not a proper way of passing data!
example:
button.accessibilityHint = "your string data"
button.addTarget(self, action: Selector(("buttonTapped")), for: UIControlEvents.touchUpInside)
func buttonTapped (sender: UIButton) {
let section = sender.accessibilityHint
}