ϏϑΥΞ&Ξϑλʔ tableView.rx.itemSelected .map { dataSource?[$0.row] } .flatMap { $0.flatMap(Observable.just) ?? .empty() } .filter { $0 > 0 } .bind(to: someObserver) .disposed(by: disposeBag) tableView.rx.itemSelected .subscribe(onNext: { indexPath in let optionalInt = dataSource?[indexPath.row] guard let int = optionalInt else { return } if int > 0 { someObserver.on(.next(int)) } }) .disposed(by: disposeBag)