var isCurrentlySearchingAddress = Variable<Bool>(false)
var currentSelectedPlace = Variable<GeocodePlace?>(nil)


当我进行订阅时

Observable.combineLatest(viewModel.isCurrentlySearchingAddress.asObservable(), viewModel.currentSelectedPlace.asObservable())


如何使用可读的变量名代替01

ios - RxSwift-如何具有可读的CombineLatest事件元素变量名称?-LMLPHP

最佳答案

您可以这样做:

    Observable.combineLatest(
        varA.asObservable(), varB.asObservable(),
        resultSelector: { value1, value2 in
            print("\(value1) \(value2)")
    }).observeOn(MainScheduler.instance)
        .subscribe()
        .disposed(by: disposeBag)

09-18 03:52