This failure of Apple to allow user to dismiss keyboard is taking its toll...
I have managed to add code to do this on a few views but now I have a ViewController with a TextView and a couple of TableViews.
After I use a Tap Gesture Recognizer to dismiss the keyboard, the taps on the table cells don't trigger. The code is as follows.
func tap(gesture: UITapGestureRecognizer) {
if gesture.view!.tag != 33 {
self.view.endEditing(true)
titleView.resignFirstResponder()
}
}
This might be belt & braces but I was trying to see if/what might work. (Tag 33 is the actual TextView)
The table cell is triggered in the usual way and without the tap gesture code it works fine.
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: false)....
An IBAction tap on a button seems to work but not the cell trigger.