So I have a storyboard with 3 buttons I want to just create 1 action for all those 3 buttons and decide what to do based on their label/id...
Is there a way to get s
Swift 4
add tag on button
let button = UIButton() button.tag = 10
click event
@IBAction func mainButton(sender: UIButton) { switch sender.tag { case 10: print("10") case 11: print("11") default: print("yes") } }
happy coding :)