TableView not accepting touches

I have a UITableView inside a regular ViewController — no scroll view or anything — that doesn't want to accept my touches. It's a really weird problem that I've never had before. To select a cell, you have to press on the cell for a good five seconds before it takes, or else it just unhighlights the cell and doesn't select it. I've tried turning the "Delay Touch Down" and "Can Cancel on Scroll" options on and off in the TableView to no avail. As I said, this is a regular UIViewController with nothing strange about it. I've seen other questions on the internet about table views inside a scroll view not working, but there is no scroll view here.


What is going on and how do I fix it?

Accepted Reply

This doesn’t appear to be a question about a feature of the Swift language, so it’s posted in the wrong forum. Cocoa Touch might be better.


It sounds like you have some other view or gesture recognizer somewhere that is interfering with touch handling. If you have any classes doing low level touch handling (touches began/moved, hitTest/pointInside etc.) I’d look there.


And of course use Xcode‘s view debugger to make sure your view hierarchy is sane: the view and all its superviews have userInteractionEnabled, no views are being drawn outside their bounds, and there is no view coveriing the table view swallowing touches.

Replies

This doesn’t appear to be a question about a feature of the Swift language, so it’s posted in the wrong forum. Cocoa Touch might be better.


It sounds like you have some other view or gesture recognizer somewhere that is interfering with touch handling. If you have any classes doing low level touch handling (touches began/moved, hitTest/pointInside etc.) I’d look there.


And of course use Xcode‘s view debugger to make sure your view hierarchy is sane: the view and all its superviews have userInteractionEnabled, no views are being drawn outside their bounds, and there is no view coveriing the table view swallowing touches.