title: Performing a segue from a button within a custom UITableViewCell
body: <p>I want to perform a segue from a button within a custom UITableViewCell, but I don't know how to access the cell's contents when I push that button. I realize that this could be accomplished through didSelectRowAtIndexPath, however I have that method performing another function, and I would like to use the button I have created within the table cell.</p>
  
  <p>Here is my perform segue method I'm having trouble with:</p>
  
  <pre><code>override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)
  {
      if segue.identifier == "showComments"
      {
          let vc:CommentOnPostViewController = segue.destinationViewController as CommentOnPostViewController
  
          var buttonPosition:CGPoint = sender?.convertPoint(CGPointZero, toView: self.feed) as CGPoint!
          var path:NSIndexPath = self.feed.indexPathForRowAtPoint(buttonPosition) as NSIndexPath!
  
          var postToCommentOn:PFObject = feedList[path.row] as PFObject
          vc.post = postToCommentOn as PFObject
      }
  }
  </code></pre>
  
  <p>I tag the button in the cell when displaying it, and give it a target action:</p>
  
  <pre><code>func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell
  {
      // There is code that goes here for creating and displaying the cell.
  
      cell.commentButton.tag = indexPath.row
      cell.commentButton.addTarget(self, action: "addComment", forControlEvents: UIControlEvents.TouchUpInside)
  }
  </code></pre>
  
  <p>Here is the action that is called when pressing the button:</p>
  
  <pre><code>func addComment()
  {
      self.performSegueWithIdentifier("showComments", sender: self)
  }
  </code></pre>
  
  <p>Any help is appreciated. Thanks!</p>