我在VIPER架构中使用Typhoon框架进行注射。我创建了2个模块,并使用每个模块的演示者进行连接。模块B的演示者有definition.scope = TyphoonScopeWeakSingleton
。但它无法注入其财产。演示者A参考了它,视图B也参考了它。
-(StatsVC*)statsView
{
return [TyphoonDefinition withClass:[StatsVC class]
configuration:^(TyphoonDefinition* definition)
{
[definition injectProperty:@selector(presenter) with:[self statsPresenter]];
}];
}
-(OTStatsPresenter*)statsPresenter
{
return [TyphoonDefinition withClass:[OTStatsPresenter class]
configuration:^(TyphoonDefinition* definition)
{
[definition injectProperty:@selector(view) with:[self statsView]];
definition.scope = TyphoonScopeWeakSingleton;
}];
}
如何注射?