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
896 stars 63 forks source link

Have different contexts for Factory and navigation #92

Closed vykut closed 1 year ago

vykut commented 1 year ago

Hello,

After we have replaced most of the navigation logic in our app with the APIs from this library, we have come across, what one might think of, a limitation of the Context approach. Currently, Factory & ContextAccepting protocols both expect a Context type, which, theoretically, can be different, but in practice we realized that it actually has to be the same.

Practically, How can I use a different Context type for creating a ViewController via Factory and a different Context for navigating to such controller and "injecting" a different state?

the Router method navigate accepts a single type of Context, so having 2 different types of Contexts - one for Factory and one for ContextSettingTask is currently not possible.

ekazaev commented 1 year ago

@vykut Thank you for your questions. Could you please read those answers here https://github.com/ekazaev/route-composer/issues?q=is%3Aissue+is%3Aclosed++hotel in the closed issues. I believe there a variety of good explanations why is that so. If it wont be enough - please ping me here and we can discuss your particular case.

vykut commented 1 year ago

Thank you @ekazaev for pointing me to those other issues. Really useful!