I want to observe the property UITextfield.editing
. I'm using this code:
self.money.rx_observe(Bool.self, "editing").subscribeNext { (value) in
print("")
}.addDisposableTo(disposeBag)
But in the process of running, it's only performed once. How do I solve this,please
Don't observe the
editing
property, because it's not just a stored property. It's defined as:So you don't know how UIKit is actually getting that value.
Instead, use
rx.controlEvent
and specify the control events you're interested in, like so:For RXSwift 3.0
Since RxSwift 4.0, there is two specific control events :
textDidBeginEditing
andtextDidEndEditing
You can used it like this :