I am new to iOS app development.
I am now having several views like in the picture below (not exactly the case), in which I could get to the third view (rightmost) through 2 subsequent segues from the first view.
EDIT: Supplementary Information: The third view is actually linked to a container in the second view. And it is a modal segue from the first to second.
And in the third view, I have a button which could bring me back to the first view by the dismissViewControllerAnimated:completion:
method. But how could I pass some data back to the first view?
I just know how to pass data between adjacent views using method like prepareForSegue:sender:
. But I'm not sure how to do it across more than 1 view.
Should I use Delegates
or Singleton
or there are other better options?
Thanks in advance.