samedi 25 février 2017

design pattern, architecture for multi level viewcontroller containment

Part of an iOS application I'm working on consists of multi level view controller containment. similar to this diagram view controller containment

I'm trying to setup the interaction/ routing in a way that isolates each child controller to it's own scope and communication between is handled through a central router in "master vc". Only one single child in the diagram is visible to the user at a time. Each child belongs to a parent controller where those parents (orange color) are managed by master vc. Master doesn;t need to know all about each children as they're encapsulated within their respective parent controllers (orange).

As an example, if an event on child-A needs to present child-X with some data, it will inform master's router instead of talking directly to child-X.

Not really looking for a complete solution but rather an advice towards a suitable design pattern or communication mechanism that supports the isolation of child controllers to their scopes and tidy up the managing of controllers.

using swift 3 (no reactive programming)

Cheers

Aucun commentaire:

Enregistrer un commentaire