title: swift: prepareForSegue indexPathForSelectedRow
body: <p>I have an UITableView populated by a cellForRowAtIndexPath:</p>
  
  <pre><code>func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
      var cell: UITableViewCell = self.tableView.dequeueReusableCellWithIdentifier("customTableViewCell") as! UITableViewCell
      let task = frc.objectAtIndexPath(indexPath) as! Task
  
          cell.textLabel?.text = task.summary
          var detail = task.detail
          var context = task.context
          var due = task.date
          var status = task.status
          var responsible = task.responsable
          var folder = task.folder
  
          cell.detailTextLabel?.text = "Contexte: \(context), Detail: \(detail), Status: \(status), Ending date: \(due)"
  
      return cell
  }
  </code></pre>
  
  <p>On the storyboard, I have made a segue when clicking one cell of the tableView to open a detailViewController</p>
  
  <p>this is my didSelectRowAtIndexPath:</p>
  
  <pre><code>func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
      let cell = tableView.cellForRowAtIndexPath(indexPath)
      self.name = cell!.textLabel!.text!
      println(self.name)
      self.performSegueWithIdentifier("Show Detail", sender: indexPath);
  }
  </code></pre>
  
  <p>and the prepareForSegue:</p>
  
  <pre><code>override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
  
      if let identifier = segue.identifier{
  
          switch identifier {
              case "Show Detail":
  
  
                  let indexPath = self.tableView.indexPathForSelectedRow()
                  let editTaskVC = segue.destinationViewController as! EditTaskViewController
  
                  editTaskVC.Name = "cell.textLabel?.text is what I would like to.."
  
  
              default: break
          }
      }
  
  }
  </code></pre>
  
  <p>If I do <code>editTaskVC.Name = indexPath?.description</code> I can see the description of the cell clicked like, <code>&lt;NSIndexPath: 0x78f96ab0&gt;...</code> for example.</p>
  
  <p>Is it possible, instead of printing the description of the indexPath, printing the cell.textLabel?.text of the clicked row?</p>
  
  <p>I have seen many, many tutorials or posts on forum but I haven't succeed to solve my problem...</p>
  
  <p>Thank you for your help.</p>
  
  <p>Regards.</p>