I know that I can do the following to map the changes to the text field of a custom Notes object in a UITextView.
self.notesViewModel.currentNote() .map { $0.text } .bindTo(self.notesTextView.rx_text)
How can I do the opposite using the same template? The template is notesTextView.rx_text, match it with the text of the current note. I know how to do the following that non-RxSwift-y feels:
_ = notesTextView.rx_text.subscribeNext { someText in self.notesViewModel.currentNote().value.text = someText }
IOW, it looks like I can take a UITextView (aka notesTextView), a map and bind the changes to the current note. The current note returns a variable with a note that has a String text field.
swift rx-swift
finneycanhelp
source share