The dreaded double-segue mistake

This turns out to be a surprisingly common mistake with table views and collection views:

  1. In the storyboard, you connect a segue from the cell prototype to another view controller.

  2. In code, you implement the delegate method didSelectRowAt or didSelectItemAt to call performSegue to trigger the segue.

The result of this mistake is that when the user taps the cell, the segue is triggered twice.

Continue reading