I have a custom UITableViewCell with a button inside to segue the data to another viewController. This is by utilizing the
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
//cell setup code
cell.button.tag = indexPath.row
cell.button.addTarget(self, action: "editRow", forControlEvents: .TouchUpInside)
return cell
}
then using the function
func editRow() {
self.performSegueWithIdentifier("editRow", sender: self)
}
the editRow segue is a storyboard segue.
The issue...Instead of performing the segue and passing the data, it fires the segue twice and doesn't transfer any data to the "SLEdit" viewController. Any ideas as to why this is happening? Please keep in mind I'm not very familiar with objective-c due to beginning learning with swift. If you need any further information or more code let me know. Thanks!
EDIT:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
if segue.identifier == "editRow" {
let cell = sender as! SLTableViewCell
let indexPath = tableView.indexPathForCell(cell)
let SListController:SLEdit = segue.destinationViewController as! SLEdit
let items:SList = frc.objectAtIndexPath(indexPath!) as! SList
SListController.item = items
}
}