3
votes

I am trying to display a modal after the accessoryView on a cell is selected.

I currently have a segue from my TableViewCell to display a modal, and I manually call performSegueWithIdentifier on this segue when the accessory button is clicked.

The problem is that the segue gets triggered from both selecting a cell and selecting an accessory view. I only want the segue to be triggered on accessory view selection.

What are the solutions?

2

2 Answers

5
votes

Right click on your prototype tableViewCell with the detail accessory in the storyboard. This brings up a black connection box. Under Triggered Segues there are two choices, selection and accessory action. Control drag from those to your desired view controllers.

2
votes

I ended up creating a segue by dragging from my first ViewController to the SecondViewController, Instead of dragging from cell to viewController. I manually call performSegueWithIdentifier with the specified identifier string, this way the segue gets called only when I want it to.