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

Make NavigationDelayingInterceptor context generic #54

Closed WingedDoom closed 4 years ago

WingedDoom commented 4 years ago

Method .adding(...) requires that RI.Context == C, which means factory and interceptor context types should be equal.

This, however, is not always possible with current implementation of NavigationDelayingInterceptor, which has Context = Any?.

Adding a generic parameter Context to NavigationDelayingInterceptor would fix the problem, and it seems easy to do, though I'm not sure how difficult it would be to refactor usages of the interceptor.

ekazaev commented 4 years ago

@WingedDoom Good catch. Thank you

ekazaev commented 4 years ago

@WingedDoom I have only one question. I did not expect that this interceptor could be applied to the particular chain of steps. I expected it to be applied to the router once as if that issue exists - it is global to the application. What is the situation that you want to add it to the one particular configuration rather than the whole router?