I have a custom TableViewController with a custom TableViewCell. I created a segue on the storyboard from the Cell to another ViewController to display the details but prepa
Drag the segue from the TableViewController in InterfaceBuilder, not from the cell. Then you can perform the segue with its identifier in didSelectRowAtIndexPath
via performSegueWithIdentifier
.
Also check the function signatures. The exclamation marks for implicitly unwrapped optionals are no longer needed:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let cell = tableView.cellForRowAtIndexPath(indexPath)
tableView.deselectRowAtIndexPath(indexPath, animated: true)
performSegueWithIdentifier("mySegue", sender: cell)
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
}