我想做一个像这个例子一样的函数。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