I am having trouble passing data back between 2 viewControllers
. They are linked with a segue and I am trying to link the data generated in the 2nd viewController
and use it in the 1st viewController
.
The way it works is the user starts at the 1st viewController
and navigates to the 2nd viewController
which contains multiple settings to choose. When they navigate back to the 1st viewController
, I want the data to be passed. With prepareForSegue
, it is very simple, but what should I do? Is there a method such as prepareForSegue that works in reverse (i.e going back to the main viewController
)? I have tried to use unwindSegues
but I am not sure if this is the appropriate method to be using. Can anyone tell me the correct way of setting this up? Or is there a different method I should use? Any help regarding what I should do would be greatly appreciated.