Statt den Code auf der Zelle direkt von (obwohl Sie es auch mit Delegation machen kann), können Sie den Code direkt auf Ihrem Controller hinzufügen und die Methode auf die Schaltfläche binden, so etwas wie dieses:
erstellen Sie eine Funktion, die den Übergang auf Ihrem UIViewController
func btnShowView(sender: AnyObject) {
self.performSegueWithIdentifier("segue_identifier",selder:nil)
}
im Prozess der Erstellung der Zelle durchführen, die auf die Schaltfläche (in Tableview hat: cel lForRowAtIndexPath :):
//Inside tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
let cell = tableView.dequeueReusableCellWithIdentifier("cellIdentifier",indexPath) as! YourCustomTableViewCell
cell.yourBtn.addTarget(self, action: "btnShowView", forControlEvents: .TouchUpInside)
//More code to configure cell...
return cell
Und das ist es.