ekazaev / route-composer

Protocol oriented, Cocoa UI abstractions based library that helps to handle view controllers composition, navigation and deep linking tasks in the iOS application. Can be used as the universal replacement for the Coordinator pattern.
MIT License
902 stars 64 forks source link

How to reverse transfer values between controllers #72

Closed beginner-byte closed 3 years ago

beginner-byte commented 3 years ago

I can't update the superior controller of controller B. please guide me how to do it

ekazaev commented 3 years ago

@BitBuilder-zreo Hi

If I understand your question correctly - then it has nothing to do with the route-composer itself. Route-composer is about the navigation and composition. The context is used to carry valuable information from one screen to another during the navigation. And after its mission is over. You need to establish connection between superior view controller and controller B yourself. For example using the delegation pattern. You can put the superior view controller as a delegate to a Context object if needed and carry it to a view controller B and subscribe it. I personally do not recommend delegates for that type of connection as it is undefined what happens with delegate in case of universal link navigation for instance. I just used it as an example how you can establish such connection. You can also use multi delegate pattern, NSNotification, Combine or anything you like.

Please let me know if you are satisfied with the answer and if I can help you more.

ekazaev commented 3 years ago

Closing due to inactivity