I've asked a similar question, and I've read countless other questions but I still can't figure this out and I've spent a few nights now trying to solve it.
I have a custom UITableView class which I have subclassed to call different things. In my subclasses I user overrides on things like didSelectRowAtIndexPath.
If I assign this to a table it works fine, except I have to do a long press in order to fire off didSelectRowAtIndexPath. Tap doesn't seem to work at all. I do have a gesture recogniser elsewhere in the project but I've disabled them all and I've still had no luck getting tap working. I've read this might be something to do with supers or touchesbegan but I feel like I'm completely stuck now. Please help me!
class BaseTable: UITableView, UITableViewDelegate, UITableViewDataSource {
var rowsInSection: Int { return 0}
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)!
//Standard table set up funcs
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
{
print(IndexPath.row)
}
}
class NewTable: BaseTable{
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print (IndexPath.row + " NEW")
}