0
votes

enter image description here

I have a tab bar controller and two destination views, one of which is a table view (static cells) and the other is a view controller. I can do a segue from one cell of the tableview to the yellow view controller but how can I do an unwind segue? I know unwind segues require some code in the destination view controller but there are no destination view controllers in this case because the table view doesn't have a separate controller and neither does the tab bar controller

1
can you post your segue code and explain what do you mean by there is no controllers ?lunaks
I was trying it without code so I just put in a tab bar controller, wired it up to a table view and a view controller and then did a segue from one of the table view cells to the yellow view controller. It works but I can't get back from the yellow view controller to the table view. That's what I mean by no controllers - it's all been done in interface builder.Steblo
You can't do that without code. why don't you want to use code? You're gonna need to make class files for your view controllers eventually.Sam_M
I realise that now Sam, and I have now made class files. But I've now got the problem of how to wire up the segues. I can segue to the yellow view controller from a cell but if I add another view controller my first segue disappears - I can only connect one segue. I'm wondering how to connect to multiple view controllers. I'll need to follow some tutorials.Steblo

1 Answers

0
votes

To implement Unwind Functionality, you have to firstly declare this function in your root view controller

@IBAction func performUnwindSegue(segue: UIStoryboardSegue)

then right click Exit menu of your root view controller in storyboard, that unwind function could be visible. Line it to your button in child view controller, then it should work.

A simple example could be found here