I have a UITableView with custom cells. Usually when the user taps the cell, it triggers this function:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
//Segue to another view
}
If in that view they mark the cell as finished, when they return the code will add the standard check accessory.
When the cell isn't finished, I'd like an empty check that can be tapped (I know I can add a custom image accessory), with the tap allowing the user to skip the segue and quickly mark the cell as finished. But I can't seem to make both work:
- Tapping on the main body of the cell should call didSelectRowAtIndexPath
- Tapping on the accessory view (empty check mark) should call a different set of code.
I've tried accessoryButtonTappedForRowWithIndexPath but it doesn't seem to even get called.
func tableView(tableView: UITableView, accessoryButtonTappedForRowWithIndexPath indexPath: NSIndexPath) {
//Shortcut code to change the cell to "finished"
}
Is it possible to have clicking on the main body trigger one set of code and clicking on the accessory view trigger another? If so, how?