0

I have a scenario like this:

        /-> C -> D \
A -> B -            -> G (Contain values of D and F, 
        \-> E -> F /

Basically at G I have a list of value produce by D and F, let us call D1 and F1.

To create a new value from G, I have to just unwind to B and user can either choose branch C or E and continue to the end G with value of D2 or F2, or he can pop back to A. Let us say the new value is F2, though ABEFG

Now I'm facing a problem, that is I want to edit the values at G, let us say D1.

I want to be able to pop back to D but also allow users pop back to C etc, but D is not in the workflow ABEFG.

My guess is that I have to back up to B and somehow prepare multiple segues up to D but I have no idea if this kind of workflow exists.

Quang Linh Le
  • 751
  • 1
  • 7
  • 16
  • Related: https://stackoverflow.com/questions/31619899/swift-unwind-segue-when-multiple-view-controllers-lead-to-same-view?rq=1 – Quang Linh Le Jun 06 '17 at 16:12

1 Answers1

0

Apparently, there is no such way. The solution I found is

  1. Find the instance of B in navigationController!.viewControllers
  2. popToViewController B
  3. Initiate C & D from Main storyboard with identifier (they are already deallocated anyway)
  4. Setup some properties of C & D from D1
  5. pushViewController C & D
Quang Linh Le
  • 751
  • 1
  • 7
  • 16