I have the following code:
deleteAllButton.setTitle("Delete", forState: .Normal)
deleteAllButton.titleLabel?.numberOfLines = 2
deleteAllButton.setTitleColor(UIColor.blackColor(), forState: .Normal)
deleteAllButton.titleLabel?.font = UIFont.systemFontOfSize(keyboardFontSize)
// deleteAllButton.addTarget(self, action: #selector(deletekeyPressed), forControlEvents: .TouchUpInside)
let deleteLPGR = UILongPressGestureRecognizer(target: self, action: #selector(deleteButtonLongPress))
deleteLPGR.minimumPressDuration = 0
deleteLPGR.delaysTouchesBegan = true
deleteAllButton.addGestureRecognizer(deleteLPGR)
Normally when a UIButton is pressed the text automatically changes color to indicate it is in a "pressed" state. However, since I have added the long press gesture recognizer the button does not indicate that it is in a "pressed" state.
How can I still allow a touch event to go through to the button so the user feels like the button is infact "pressed"?