I'm new to IOS development and swift so I'm a bit confused. Building on this question
Swipe To Edit Details Swift and Parse
I have a table cell that I swipe and when I click edit, I want it to go to another page to edit the details. When i don't have a segue, it asks for one as an error. When I put one (going from prototype cell > edit page), it works, except now it goes there when I click on the cell in addition to swipe.
I just want it to Edit only on swipe. How would one do that?
Am I supposed to suppress the default action of the segue in
prepareForSegue
so thatEditDetails
segue gets triggered only when I tell it to (like below)?var editAction = UITableViewRowAction(style: .Default, title: "Edit" , handler: { (action:UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in dispatch_async(dispatch_get_main_queue()) { self.performSegueWithIdentifier("EditDetails", sender: tableView.cellForRowAtIndexPath(indexPath)) } }) editAction.backgroundColor = UIColor.greenColor()
Am I supposed to create the segue in code instead of through the UI, so it doesn't add any additional actions that I don't need?