1

I have 3 ViewControllers, VC1, VC2 and VC3. VC1 and 2 is using navigation Controller bars with a back button. VC3 is using a segue back to VC2.

When I segue back from VC3 to VC2, the "back"-button on the navbar takes me back to VC3 and not VC1. So I'm stuck in that loop and I wonder how to break off and make it so that the "back"-button takes me where it is supposed to, to VC1.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Alvarsson
  • 115
  • 3
  • 7
  • Segues work only in the context of pushing and popping VCs onto a navigation controller, so what do you mean when you say that VC3 isn't in the nav controller, but has a segue back to VC2? – NRitH Aug 10 '17 at 14:55
  • Use segue for going forward, not going back. System will manage the back-action for you automatically. – Yun CHEN Aug 10 '17 at 15:00
  • Oh so segue might not be the way to go? The reason i use segue is because i want to move data between VC3 and VC2, can i do that without segue? – Alvarsson Aug 10 '17 at 17:35
  • For this you can use either the delegate-pattern or unwind-segues (https://stackoverflow.com/questions/12561735/what-are-unwind-segues-for-and-how-do-you-use-them) – fguchelaar Jul 07 '18 at 10:05

0 Answers0