Swift 4.0 code (Here we go again)
The called action should marked like this because that is the syntax for swift function for exporting functions into objective c language.
@objc func deleteAction(sender: UIButton) {
}
create some working button:
let deleteButton = UIButton(type: .roundedRect)
deleteButton.setTitle("Delete", for: [])
deleteButton.addTarget(self, action: #selector(
MyController.deleteAction(sender:)), for: .touchUpInside)