I simply added two observables:
mainView.textField.rx.text.orEmpty.bind(to: viewModel.searchPhrase).disposed(by: bag)
mainView.textField.rx.controlEvent(.editingChanged).asObservable().subscribe(onNext: { [weak self] in
print("voilala")
}).disposed(by: bag)
Now I would like to call actions from code to perform subscriptions and binding. Is it possible?
Simply:
view.textField.insertText("someText")