Q:

searchBar.rx.textDidBeginEditing does not working when im trying to edit text

    searchBar.rx.textDidBeginEditing
        .subscribe { [unowned self] in
            print("im begining diting")
            self.searchBar.setShowsCancelButton(true, animated: true)
        }
        .disposed(by: disposeBag)

It does not working, maybe I have wrong method? but I have method 
    searchBar.rx.text
        .asObservable()
        .bind(to: directoryViewModel.searchTextObservable)
        .disposed(by: disposeBag)

Its working properly

A:

I forgot to put onNext:
searchBar.rx.textDidBeginEditing
.subscribe(onNext: { [unowned self] in

    self.searchBar.setShowsCancelButton(true, animated: true)

}).disposed(by: disposeBag)

