When the cancel button of the search bar is tapped I want to resign the keyboard but the current issue is that my function to handle the cancel button is not working.. You can see my code here:
searchBar.rx.cancelButtonClicked
.asDriver(onErrorJustReturn: ())
.drive(onNext: { [searchBar] in
searchBar?.searchTextField.resignFirstResponder()
}).disposed(by: disposeBag)