I'm facing with a complex design problem. Due to a hard designed graphic I can't use Apple navigation pattern as UINavigationController
or other ones. This is the app diagram
Black arrow: protocols direction Blue arrow: parent-child pattern direction
I created this flow because I want to maintain the code inside the single ViewController
clear and isolated: I thought about them as modules that they can be used somewhere in other apps. The RootViewController
is the MainVCs
position manager. It decides which is the current view-controller that it must be showed and it configures it based on its status (modified by delegate methods). The single MainVC
doesn't know that RootVC
exists and it call Root using protocols. The single ChildViewController
doesn't know that its MainVC
exists and it call the Main using protocols and so on.
Code is clear and much easy to understand, my purpose, but when I have to apply a modify to the skeleton (RootVC
) from the ChildViewControllerN
, child of the umpteenth ChildViewController
, child of the umpteenth MainViewController
, I have to propagate the protocol until the RootViewController
.
My first question is: is this pattern correct? What do you think about it?
My second question is: is there a limit point where I haven't to use delegate pattern but something like KVO
?
Aucun commentaire:
Enregistrer un commentaire