Swift Uibutton establece programáticamente la función ONTAP
myButton.addTarget(self, action: #selector(myButtonTapped), for: .touchUpInside)
@objc func myButtonTapped() {
print("My button was tapped!")
}
TheKrisinator