我想做一個像這個例子一樣的函數。RxSwift - 在一個可觀測值內的多個可觀測值
例如
let num1 = Driver<Int>
let num2 = Driver<Int>
let result = Driver<String>
num1 = Observable.just(...).asDriver()
num2 = Observable.just(...).asDriver()
result = ??? // When both num1 and num2 are subscribed, this becomes a higher value among them as String.
// This type of code will be used
/*
if $0 >= $1 {
return "num1 = \($0)"
} else {
return "num2 = \($1)"
}
*/
如何實現的呢?
謝謝。我正在尋找這個! – Byoth