I'm trying to use the ReactiveCocoa library. But when I use the ReactiveCocoas flatMap function, I get an error. Does anyone know how to get around it? Maybe I'm doing something wrong?
let countValues = countEditAView.reactive.continuousTextValues
let flatMapClosure: (String?) -> SignalProducer<Int, NSError> = { (input) in
return SignalProducer.init(value: 3)
}
let filterClosure: (Int) -> Bool = { (input) in
if (input < 0) {
return false
} else {
return true
}
}
let signalDisposable = countValues // <- Ambiguous reference to member 'flatMap'
.flatMap(FlattenStrategy.concat, flatMapClosure)
.filter(filterClosure)
.observeValues { val in print("val = \(val )") }