I have a Main Menu-type View Controller (let's call it MainVC
) with 2 buttons - one modally presents another regular VC (SourceVC); the other pushes a Table VC (DestinationVC
). SourceVC
and DestinationVC
are NOT directly connected.
Whenever the SourceVC
performs MethodX
, it creates an object. I want SourceVC
to send that object to DestinationVC
when MethodX
ends so that it can be stored in its table. My questions are:
Is there a way to pass the object directly from Source to Destination (i.e. delegate)?
If not, then how should I go about passing this data?
Edit Just for clarity's sake, I want to emphasize that the VCs passing data are NOT connected/transitioning directly.
The question of passing data between VCs was asked many times before; however, in each instance, the VCs were DIRECTLY connected (i.e. SourceVC Pushes/Modally Presents DestinationVC). I wanted to know if it was different to send data INDIRECTLY, (in my case, Main View Modally Presents SourceVC, Main View Pushes DestinationVC). I know how to do the former, but I'm having trouble when the VC's are separate. Sorry for any confusion.