0

enter image description here

enter image description here

In the Diagram above, I have 2 different view controllers that segue to the same "Detail View Controller". I have set them both up with unwind methods following the tutorial by apple it shows how to achieve what I wanted with only one view controller connected to it. https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift

However, I wanted to take things a step further and see if I could do it with 2 that would point to the same VC.

As of right now I have 2 VC's with unwindTo methods. I have control dragged the save button onto the exit button in VC and selected both unwind Methods

Edward Lim
  • 763
  • 9
  • 31
  • What about this answer http://stackoverflow.com/a/32400840/5327882 – ronatory Nov 03 '16 at 21:18
  • I think I get the idea behind his solution but it dosent seem to be working for me – Edward Lim Nov 03 '16 at 21:43
  • You need to learn about UINavigationViewController, maybe it can help you with your problem. With navigation controller you can push view controllers and back. – ViTUu Nov 03 '16 at 22:03
  • I seem to don't understand, am I using navigation controllers wrongly in my app? Because I do have navigation controllers and Im following the swift tutorial provided by apple and unwinding is what they do with navigation controllers – Edward Lim Nov 03 '16 at 23:44

1 Answers1

0

The following Link has the correct answer for this question, Basically in order to perform what I had requested. The unwind functions name has to be called the same thing in both View Controllers that are segueing to the same thing

VC1:

@IBAction func unwindFromDetails(sender: UIStoryboardSegue)

VC2:

@IBAction func unwindFromDetails(sender: UIStoryboardSegue)

https://stackoverflow.com/a/34297839/5158516

Community
  • 1
  • 1
Edward Lim
  • 763
  • 9
  • 31