How to handle "Done" return key press event in rxSwift?
You can subscribe to UIControlEvents like this:
textField.rx_controlEvents(.EditingDidEndOnExit).subscribeNext {
print("return pressed")
}
In Rxswift 3.0
textField.rx.controlEvent([.editingDidEndOnExit])
.subscribe(onNext:{text in
print(text)
}).addDisposableTo(disposeBag)
In RxSwift 4 and 5:
textField.rx.controlEvent([.editingDidEndOnExit]).subscribe { _ in
print("editingDidEndOnExit")
}.disposed(by: disposeBag)