Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView didSelectRowAtIndexPath only recognize taps with two fingers

I'm attempting to present a UIAlertController when a UITableViewCell is selected. I have checked all the storyboard-related issues such as Selection: Single Selection and even set tableView.allowsSelection = true at the top of viewDidLoad(). I also checked the issues of using didDeselect as opposed to didSelect.

Oddly enough the cell only selects when I tap it with two fingers at the same time or when I press it for a longer period of time (about 2s and then release). Is this a known problem?

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    print("Tap registered")
}

Any amount of help would be greatly appreciated.

like image 868
Albin Martinsson Avatar asked Oct 30 '22 02:10

Albin Martinsson


1 Answers

I had similar problem but saw other posts noting that a UIGesture Recognizer attached to parent view was the problem. I had done just that. The Gesture recognizer was used to dismiss the keyboard. So for what it is worth make sure you take care when using an UIGestureRecognizer in a UITableView.

like image 189
art Avatar answered Nov 15 '22 06:11

art