0
votes

I have a project in Swift 2 with two Table View Controllers embedded in two Navigation Controllers with segue in between.

Simply: Table View A -> Table View B

There is a + button in Table View A that segues modally to Table View B. There is a Back button in Table View B that should unwind segue back to Table View A.

I have crated the @IBAction func unwindFromSegue(segue: UIStoryboardSegue) function in the destination view controller (where I want to unwind to).

I have connected the Back button with ctrl+drag to the Exit of Table View B (and connected to the unwindFromSegue function).

But the unwind segue is not happening at all :( Simply clicking on the Back button does not do anything.

What can be wrong?

1
I finally figured it out myself (after two days). My Table View A was not attached the my custom view controller. Istead, it used the default UITableViewController (where my unwind function was not present). How could I missed it... Anyway: after attaching two custom view controller classes to the two view controllers seems to have solved the problem.adamsfamily

1 Answers

0
votes

I have a project in Swift 2 with two Table View Controllers embedded in two Navigation Controllers with segue in between.

There's your problem right there. To be able to push and pop (unwind) they need to be in the same navigation controller, not two different navigation controllers. You should not be using any unwind segue at all: you should have

navigation controller -> table view 1 -> (push) table view 2

The back button in the navigation bar will then just work.