You create two different ways to do this.
1 - The first alternative - use only storyboards and prepare ForSegue:
Connect your prototype cell to the second view manager in the storyboard (the connection should start from the cell and end on the second view manager). In this case, you should use only the prepareForSegue method, not didSelectRowAtIndexPath. The second VC is automatically activated after the prepareForSegue command.
2 - The second alternative is use didSelectRowAtIndexPath:
You use didSelectRowAtIndexPath only if you connect segue from the first view controller (and not from the cell) to the second view manager. At the end of the didSelectRowAtIndexPath method, you must call performSegue.
Lombax
source share