I am using ReactiveCocoa 5.0 alpha 3, ReactiveSwift and Swift 3
I am having issues with binding my UITextField to a MutableProperty.
In ReactiveCocoa 4, I used this:-
extension UITextField {
func signalProducer() -> SignalProducer<String, NoError> {
return self.rac_textSignal().toSignalProducer()
.map { $0 as! String }
.flatMapError { _ in return SignalProducer<String, NoError>.empty }
}
}
viewModel.email <~ emailTextField.signalProducer()
But now in ReactiveCocoa 5, I am not able to do that. From what I understand, I am supposed to do something like this I guess:-
viewModel.email <~ emailTextField.reactive.textValues
But either it says '<~' is unresolved or textValues is not a property.
Please help me bind this.
The
<~in Rac5 is a function for binding aBindingTargetwith a signal, u can use it like this:or this:
And make sure you have imported the module
ReactiveSwiftin the files which you use<~.