I'm implementing a chat UI, and using Reactive Cocoa to adjust the chat bubble's size as the user types. Currently, I'm updating the UI's layout based on the textview's rac_textSignal
. Everything's working great - except for one bit: when the user sends the message, I programmatically clear the textfield:
_inputTextView.text = @"";
... but the textview's rac_textSignal
doesn't activate. I hear this is a feature with ReactiveCocoa - but what's the proper way to build this? Do I need to have an NSString holding the currentlyTypedString
, and drive the UI changes when that string updates?
RACSignal.combineLatest([self.textView.rac_textSignal(), RACObserve(self.textView, "text")]
yadda yadda yadda. That way you subscribe to both UI and programatic updates – Ozan