I have a populated TableView with several dynamic cells. I have the code to perform a segue once a cell is tapped, however I need to make it so that each cell performs a different segue. Can someone help me, because the code I am using just continues to perform the first segue no matter which cell i press!
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
NSLog("You selected cell number: \(indexPath.row)!")
if indexPath.row == 0
{
self.performSegueWithIdentifier("MoveToSignIn", sender: self)
}
if indexPath.row == 1
{
self.performSegueWithIdentifier("MoveTo2", sender: self)
}
}
Aucun commentaire:
Enregistrer un commentaire