I am trying to declare a property in view model that i will later bind to a view..
class LoginViewModel {
let myProperty = MutableProperty("")//error here undeclared type MutableProperty
}
I am using ReactiveCocoa '5.0.0-alpha.3'.
I am trying to declare a property in view model that i will later bind to a view..
class LoginViewModel {
let myProperty = MutableProperty("")//error here undeclared type MutableProperty
}
I am using ReactiveCocoa '5.0.0-alpha.3'.
On
To monitor the textField/ textView values changed, this code works for me:
passwordTF.reactive.continuousTextValues.observeValues({ print("the new value is \($0!)") })
And the console log like this:
the new value is q
the new value is qw
the new value is qwe
the new value is qwer
There is a other method to monitor the value when the editing is ended:
passwordTF.reactive.textValues.observeValues({ print("the new value is \($0!)") })
And the console log the result in one line:
the new value is qwer
Since ReactiveCocoa was split into
ReactiveCocoaandReactiveSwift, you'll probably need to import@import ReactiveSwiftin your file as well as@import ReactiveCocoaAlso, if you're adding ReactiveCocoa via Carthage, dont forget to also add the
ReactiveSwift.frameworkto your Project.