I saw some example codes that assign the same OnClick event to all the buttons in Android (even if they perform completely different action) . How can do it with Swift
Swift 4.*
button.addTarget(self, action: #selector(didButtonClick), for: .touchUpInside)
And the button triggers this function:
@objc func didButtonClick(_ sender: UIButton) { // your code goes here }