Swift 2.2 syntax error: cannot cause value of non-functional type "UITableView!"

I use Tab for gestures in a UITableView cell, but the following error occurs.

"Unable to call value of non-function type" UITableView! "I use the following code that I inherited from a previous Objective-C project:

var p: CGPoint = sender.locationInView(self.tableView) var indexPath: NSIndexPath = self.tableView(forRowAtPoint:p) var buttonTag: Int = indexPath.row var selectView = self.storyboard?.instantiateViewControllerWithIdentifier("DropDownSelectionViewController") as? DropDownSelectionViewController var selectWithNaviBar: UINavigationController = UINavigationController(rootViewController: selectView!) if (buttonTag == TEAM_ROW) { getPeoplesWithMenuType(TEAM) }else{ if (buttonTag == OFFICES_ROW) { selectView?.menuName = OFFICES_MENU // selectView?.isMultipleSelection = yes }else if(buttonTag == CATEGORIES_ROW){ }else if(buttonTag == INTERNAL_GROUPS_ROW){ } } 

I would be grateful if someone could help.

+3
ios uitableview swift
source share
1 answer

This line

 self.tableView(forRowAtPoint:p) 

is a source of problems. You probably want self.tableView.indexPathForRowAtPoint(p)

+3
source share

All Articles