This is a serious problem for me right now. Working on a code base with multi-level children’s dispatcher presentations about 4-5 layers in size is an application for tablets with a very high degree of isolation between viewcontrollers dispatchers. The 5th level child view manager wants to send a message to the top level view manager to show the modal. Level 4 and level 3 have different messages, so basically now I have 4 protocols, and it’s quite difficult to send messages from such child view controllers nested in depth in the ancestor view controller. Is there an easier way to do this?
We thought about using NSNotification, but we didn’t particularly like it because of the complexity of its debugging and subscription, which is not an explicit dependency within our control. We also thought about using a singleton, but statics and singletones are evil (right?) And cause problems around state and concurrency.
Any help is appreciated. I also understand that I understand that this is a slightly open-ended question, based on design, but it has a very specific use case (for example, described above).
source share