Here’s my situation.
I have ViewControllerA and it is capable of loading ViewControllerB thru presentModalViewController. Now, ViewControllerB can later on push ViewControllerC into view. Both ViewControllerB and ViewControllerC are the same class. How do I assign ViewControllerA as the delegate when I push ViewControllerC into view?
Currently, I’m assigning ViewControllerB as ViewControllerC‘s delegate, which then calls ViewControllerA and I feel that this is not so right. Chain of command: ViewControllerC -> ViewControllerB -> ViewControllerA
Thanks.
I feel like the design is a little clumsy. Instead of passing the delegate back down the chain why not just assign the delegate of both ViewControllerB and ViewControllerC to viewControllerA (since they are the same class). You shouldn’t have to pass up the chain unless C needs to communicate with B.
Before presenting the ViewControllerB:
in ViewControllerB before pushing ViewControllerC
in this way both B->A and also C->A