var isCurrentlySearchingAddress = Variable<Bool>(false)
var currentSelectedPlace = Variable<GeocodePlace?>(nil)
当我进行订阅时
Observable.combineLatest(viewModel.isCurrentlySearchingAddress.asObservable(), viewModel.currentSelectedPlace.asObservable())
如何使用可读的变量名代替
0
和1
?最佳答案
您可以这样做:
Observable.combineLatest(
varA.asObservable(), varB.asObservable(),
resultSelector: { value1, value2 in
print("\(value1) \(value2)")
}).observeOn(MainScheduler.instance)
.subscribe()
.disposed(by: disposeBag)