因此,我的导航栏中有一个UIBarButtonItem,希望像这样使用RAC():
RAC(myButton, enabled) = [RACSignal
combineLatest:@[ RACObserve(self, password), RACObserve(self, passwordConfirmation) ]
reduce:^(NSString *password, NSString *passwordConfirm) {
return @([passwordConfirm isEqualToString:password]);
}];但当被点击时,命令也要捕获,如下所示:
myButton.rac_command = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input) {
// Do stuff
return [RACSignal empty];
}];当我将这两者组合在一起时,我会得到一个断言错误。
因此,问题是:如何组合使用RAC()和rac_command?
发布于 2014-03-12 14:58:19
使用-[RACCommand initWithEnabled:signalBlock:]代替。
https://stackoverflow.com/questions/22347423
复制相似问题