Open semnyqu opened 7 years ago
I don't really understand the problem you're having, but it sounds like you're saying that
weakself.textField.text = subText;
is not causing the signal to send a new value. This is the expected behavior. -rac_textSignal
does not send values in response to calling -[UITextField setText:]
. It only sends values in response to user input.
copy: https://github.com/ReactiveCocoa/ReactiveCocoa/issues/3179#issuecomment-247982879
RACSignal signal1 = self.textField.rac_textSignal; RACSignal cSignal1 = [signal1 distinctUntilChanged]; [cSignal1 subscribeNext:^(NSString *number) {
first input text: 1234567891234567 second input text: 12345678912345678; show subtext: 1234567891234567 third input text: 12345678912345678; show subtext: 12345678912345678 because the subscribeNext block is not called;