Ios 伤寒选择疗法
如果我可以使用matcher根据协议选择定义,那就太好了,例如:Ios 伤寒选择疗法,ios,objective-c,dependency-injection,typhoon,Ios,Objective C,Dependency Injection,Typhoon,如果我可以使用matcher根据协议选择定义,那就太好了,例如: - (UIViewController *)viewControllerForViewModel:(id <IViewModel>)viewModel { return [TyphoonDefinition withOption:viewModel matcher:^(TyphoonOptionMatcher *matcher) { [matcher conformsToProtocol
- (UIViewController *)viewControllerForViewModel:(id <IViewModel>)viewModel
{
return [TyphoonDefinition withOption:viewModel matcher:^(TyphoonOptionMatcher *matcher)
{
[matcher conformsToProtocol:@protocol(ILoginViewModel) use:[self loginViewController]];
[matcher conformsToProtocol:@protocol(IMainViewModel) use:[self mainScreenViewController]];
[matcher defaultUse:[self emptyScreen]];
}];
}
台风选择匹配器
- (void)conformsToProto:(Protocol *)aProtocol use:(id)injection
...
- (TyphoonOptionMatch *)matchForValue:(id)value {
...
BOOL isConformProto = (match.proto && [value conformsToProtocol:match.proto]);
此功能在3.4.5中已被删除
嗨,埃米尔!看起来这是一个不错的功能-我已经添加了相应的问题:。很高兴看到你的公关!
- (void)conformsToProto:(Protocol *)aProtocol use:(id)injection
...
- (TyphoonOptionMatch *)matchForValue:(id)value {
...
BOOL isConformProto = (match.proto && [value conformsToProtocol:match.proto]);
[matcher caseConformsToProtocol:@protocol(IMainViewModel)
use:[self mainScreenViewController]];