-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception with reason: 'Key is already registered.' #554
Comments
I found a solution for this problem. We can change definition.key from configuration. It will look like this: return [TyphoonDefinition withClass:[FavoritesRouter class] configuration:^(TyphoonDefinition *definition) {
definition.key = @"FavoritesModuleAssembly_router";
[definition injectProperty:@selector(viewController) with:[self view]];
}]; The solution seems to be ugly because we’ll have to change the definition.key on all definitions. |
@jasesuperhero You can also consider namespacing your methods: favoritesRouter |
@jasperblues Yeah, sure. But if we use TyphoonAssemblies for MVVM or VIPER modules creation we’ll have problems with using common protocol or class with the same names in one module. Every VIPER module has view, presenter, interactor, also we have some runtime magic using the exact names. For example: @protocol MVVMAssebly <NSObject>
@required
- (id)model;
- (id)view;
- (id)viewModel;
@end |
Relates to: #446 |
In #446 pr we got the opportunity to create definitions with configs, that has specific definition.key. But in current case it's not useful, because we want to create definitions with uniq keys in range of one assembly and using configuration in code. I found the method |
I have two properties in AppAssembly - SearchModuleAssembly and FavoritesModuleAssembly. AppAssembly, SearchModuleAssembly, FavoritesModuleAssembly are initial assemblies.
It's throwing an exception on run "reason: 'Key 'router' is already registered.'".
The text was updated successfully, but these errors were encountered: