I have a table view with different types of table view cells in it. In one of the cells, there are two buttons, which load a view controller when pressed. I am using the followi
Answer by can poyrazoğlu:
are you sure you've wired up the actions correctly in interface builder? maybe you've wired the event for, say, both touch up inside and touch down inside instead of just touch up inside. or maybe you've also assigned the segue from both code and again in interface builder. have you checked them? it's a common mistake. –
I was assigning the touch up inside actions for each button both the storyboard and my tableview's datasource methods.
Thank you for your quick help can poyrazoğlu!!
I always get this issue when I have my buttons directly wired up to the destination view controller. You need to make sure that you first delete the old segue you made, then click on the present view controller (where you are coming from) and CTRL + click to destination controller.
This should fix it :)
Maybe you want to wire up your segues with View Controllers instead of UIButtons!
You should probably have the segues wired with some button like this:
But you should wire them with the view controllers instead:
For Swift 3, xcode, and ios 9+, which is what I am using: Make sure you are drawing segue from your UIViewControllers and not buttons or other interfaces.
I had the same problem, and simply changing the start of the segue from the UIController instead of the button removed this bug.