Use -[RACCommand initWithEnabled:signalBlock:]
instead.
RAC() and .rac_command are not working together
-
13-06-2023 - |
سؤال
So I have a UIBarButtonItem in my navigation bar and want to use RAC() like this:
RAC(myButton, enabled) = [RACSignal
combineLatest:@[ RACObserve(self, password), RACObserve(self, passwordConfirmation) ]
reduce:^(NSString *password, NSString *passwordConfirm) {
return @([passwordConfirm isEqualToString:password]);
}];
But also rac_command to catch when tapped, like this:
myButton.rac_command = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input) {
// Do stuff
return [RACSignal empty];
}];
When I combine those two, I get an assertion error.
So the question is: How can I use RAC() and rac_command in combination?
المحلول
لا تنتمي إلى StackOverflow